Ensure the status check rejects invalid paths.
(client)
| 173 | ### --- PMKID TESTS --- ### |
| 174 | |
| 175 | def test_capture_pmkid_path_traversal_prevention(client): |
| 176 | """Ensure the status check rejects invalid paths.""" |
| 177 | payload = {'file': '/etc/passwd'} # Malicious path |
| 178 | response = client.post('/wifi/pmkid/status', json=payload) |
| 179 | |
| 180 | assert response.status_code == 400 |
| 181 | assert response.get_json()['status'] == 'error' |
| 182 | assert 'Invalid capture file path' in response.get_json()['message'] |
| 183 | |
| 184 | ### --- CRACKING TESTS --- ### |
| 185 |