Fix weak-password-hash false positives in crypto_usage extractor - #164
google-labs-jules[bot] wants to merge 1 commit into
Conversation
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.
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Closed automatically — duplicate of #161. Both change exactly 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 |
Fixes an issue where
crypto_usage.pyfalsely flagged password-associated functions generating random tokens/session IDs or caching non-credential identifiers as weakly hashing passwords.Changes:
_NON_CREDENTIAL_ARGUMENTregex insrc/websec_validator/extractors/crypto_usage.pyto 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 theweak-password-hashrule.test_crypto_usage_skips_benign_non_credential_args_in_pw_contextregression test inside theFalsePositiveRegressionTestsclass 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