-
Notifications
You must be signed in to change notification settings - Fork 0
🛡️ Sentinel: [CRITICAL] Fix hardcoded password in test comment #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,4 @@ | ||||||
| ## 2024-04-10 - Hardcoded password in tests | ||||||
| **Vulnerability:** A hardcoded password ("kanbanery") was found in a comment in `tests/inference_test.py`. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do not store the credential literal in the remediation log. Line 2 still contains the password value ( Suggested fix-**Vulnerability:** A hardcoded password ("kanbanery") was found in a comment in `tests/inference_test.py`.
+**Vulnerability:** A hardcoded password ("[REDACTED]") was found in a comment in `tests/inference_test.py`.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| **Learning:** Hardcoded credentials even in test comments or disabled code are security risks and violate security conventions. | ||||||
| **Prevention:** Never hardcode passwords in test files or comments. Use environment variables (e.g., TEST_PDF_PASSWORD) instead. | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,7 +44,7 @@ def test_mutlinline(tmp_path): | |
|
|
||
|
|
||
| def test_encrypted_failure(tmp_path): | ||
| # Reminder to future Joe: password for encrypted PDF is "kanbanery" | ||
| # Reminder to future Joe: password for encrypted PDF should be provided via environment variable, e.g., os.environ.get("TEST_PDF_PASSWORD") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comment at Line 47 is misleading relative to current behavior. Line 47 says password should come from 🤖 Prompt for AI Agents |
||
| output_path = tmp_path / "output.pdf" | ||
|
|
||
| with pytest.raises(commonforms.exceptions.EncryptedPdfError): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the correct incident date for auditability.
Line 1 says
2024-04-10, but this PR/security event is dated April 10, 2026. If this is the current incident entry, update the heading date to2026-04-10to keep the journal timeline accurate.🤖 Prompt for AI Agents