Repository navigation
Conversation
… suite pyproject restricted python_files to test_*.py, so the 11 verify_NNN_*.py security regression files (51 tests) were never collected by bare pytest or CI. Add verify_*.py to python_files. While enabling them, two verify_012 cases were found to be vacuous: the bearer-header and access_token-query tests used ghp_-prefixed tokens, which the raw-prefix pass masks regardless, so disabling either pass left them green. Switch them to opaque tokens so each exercises its own pass, and drop an unused pytest import. Closes #38 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
verify_013 forces os.umask(0o022) and never restored it. Harmless while the file was uncollected; now that CI runs verify_*.py, the changed umask leaked into every later test in the process. Save and restore it with an autouse fixture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
srujan-2025
left a comment
There was a problem hiding this comment.
Reviewed at 3ff5477. No blocking findings. Independently verified that collection adds all 51 security regression tests and the full agent suite passes (1,190 passed, 1 skipped). Confirmed the updated redaction tests detect disabled Bearer/query-token passes, and the umask fixture restores the caller’s setting even after test failure. The changes look correct and appropriately scoped.
Closes #38.
What
vulnhunter-agent/pyproject.tomlnow setspython_files = ["test_*.py", "verify_*.py"]. Before this change, none of the 11tests/verify_NNN_*.pyfiles (VULN-001…013, 51 tests) were collected by barepytest, so CI never ran them. Keeping theverify_NNNnames, rather than renaming the files, preserves their link to the findings.verify_012tests able to fail.test_bearer_header_redactedandtest_access_token_query_redactedusedghp_-prefixed tokens. The raw-token-prefix pass masks those no matter what, so the Bearer and query-param passes had no effective test coverage. Disabling either pass inagent/_url.pyleft the whole suite green. They now use opaque tokens.import pytestinverify_012left over from Add client_secret redaction pass to credential scrubber #17.verify_013from leaking the process umask. Its tests callos.umask(0o022)and never restored the previous value. That didn't matter while the file wasn't collected, but now the changed umask would carry into every test that runs after it. An autouse fixture now saves and restores the umask. Checked underumask 077: a probe test that runs afterverify_013fails without the fixture and passes with it.Verification
pytestonmainverify_*pyteston this branchverify_*), 1 skippedtest_bearer_header_redactedfails (passed before this change)access_tokenquery pass disabledtest_access_token_query_redactedfails (passed before this change)All newly collected tests pass, so this adds coverage without breaking CI.
🤖 Generated with Claude Code