Skip to content

Fix weak-password-hash false positives in crypto_usage extractor - #164

Closed
google-labs-jules[bot] wants to merge 1 commit into
mainfrom
jules-2108544271103299497-03e03ec5
Closed

google-labs-jules[bot] wants to merge 1 commit into
mainfrom
jules-2108544271103299497-03e03ec5

Conversation

@google-labs-jules

Copy link
Copy Markdown

Fixes an issue where crypto_usage.py falsely flagged password-associated functions generating random tokens/session IDs or caching non-credential identifiers as weakly hashing passwords.

Changes:

  • Expanded the _NON_CREDENTIAL_ARGUMENT regex in src/websec_validator/extractors/crypto_usage.py to correctly identify common random bytes function calls (randomBytes, uuid, Date.now, etc.) and non-credential identifier arguments (username, session_id, org_id, etc.) that were falsely triggering the weak-password-hash rule.
  • Added a test_crypto_usage_skips_benign_non_credential_args_in_pw_context regression test inside the FalsePositiveRegressionTests class to ensure stability.

Risk: Low. Tightens the specificity of an existing rule via a regex modification. No external dependencies are added, and the test suite verifies no degradation.


PR created automatically by Jules for task 2108544271103299497 started by @raccioly

Expands the _NON_CREDENTIAL_ARGUMENT allowlist to permit common identifiers
(username, session IDs, standard PRNG function calls) passed into hash updates
within a password-related scope without incorrectly flagging them as weak
password hashes. Adds a regression test suite to lock in this correctness.
@google-labs-jules

Copy link
Copy Markdown
Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions

Copy link
Copy Markdown
Contributor

Closed automatically — duplicate of #161.

Both change exactly src/websec_validator/extractors/crypto_usage.py, tests/test_pentest_regressions.py. Matched on changed files rather than title, since the same change gets worded differently each attempt.

Continue the work in #161.


@jules — before opening a PR, search open and closed PRs for the same change. This one has been proposed many times over. The repo rule is in AGENTS.md under Automated agents: no duplicates, and a new PR only for a genuinely new finding backed by evidence (a failing test for a defect, a reproduction for a false positive).

@github-actions github-actions Bot added the auto-closed Closed automatically by bot-PR triage label Sep 27, 2026
@github-actions github-actions Bot closed this Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-closed Closed automatically by bot-PR triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants