fix(linter): make owasp-no-credentials-in-url token-aware #253
All Vouch review confidence checks passed
Residual risk 0.32 = Change Risk (0.75) × (1 − Review Confidence (0.58)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.75 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.075
Real PR Conversation Timeline
1 comments
"Review active on #253"
general
weight: 0.35
david-long1
owasp-no-credentials-in-urlmatched parameter names with a case-insensitive, unanchored regex, so any name that merely containedsecretortokenwas reported:secretPath,secret_path,tokenId,secretName. A secrets-manager API whose path parameters name the location of a secret could not pass the rule without disabling it for the whole document.The rule now splits the parameter name into words on
_,-,., digits and camelCase boundaries (acronym runs are handled, soX-API-KeyandAPIKeyboth becomeapi,key) and flags the parameter only when the head (last) word is a credential word:secret,token,password,passwd,pwd, orkeyqualified byapiorsecret. Glued names such asaccesstokenandapikeystill match via a suffix check on the head word; the qualified-key forms use the same suffix rule, somyapikeyandsalesapikeyare flagged whilemonkeyandturkeyare not. Rule ID, message text, and default severity are unchanged, so existinglint.yamloverrides keep working. As a side effectapi_key,passwdandpwdare now flagged where the old regex missed them. Names such assecretValueorpasswordHash, where the credential word is not the head, are no longer flagged; that is the trade-off the head-word rule makes, and it is easy to extend if wanted.Fixes #251
| Parameter name | Before | After |
| --- | --- | --- |
|
secretPath| error | ok ||
tokenId| error | ok ||
secretName| error | ok ||
keyName| ok | ok ||
clientSecret| error | error ||
access_token| error | error ||
X-API-Key| error | error ||
api_key| ok | error ||
myapikey| error | error ||
salesapikey| error | error ||
password| error | error |Testing
Against the reproduction from the issue, plus
tokenId,clientSecretandX-API-Keyas query parameters:The new
_AllowsDescriptiveNamesand_FlagsCredentialNamestables were also run against the old regex to confirm they are load-bearing: every descriptive name failed, andapi_key,passwd,pwdfailed on the flag side.Follow-up: glued qualified-key names and fixture quoting
The first cut compared the head word against
apikey/secretkeyby equality, so a single glued word that merely ends in one of them (myapikey,salesapikey,mysecretkey) fell through, even though the old regex caught it. The qualified-key check now uses the same suffix rule as the other credential words. ThelintQueryParameterNametest helper also double-quotes the name it splices into its YAML fixture (viastrconv.Quote) and asserts the parsed parameter carries the name unchanged, so names containing:, spaces or YAML reserved words cannot break or silently change the fixture.New table entries:
myapikey,salesapikey,mysecretkey,MyAPIKey,mytoken,mysecret,oldpasswordmust flag;turkey,no,on,nullmust not (alongside the existingkeyName,sortKey,monkey). Run against the previous commit,myapikey,mysecretkeyandsalesapikeyfail on the flag side; with the fixture left unquoted,nullfails the new round-trip assertion (the name parses as empty), which is the silent-change case the quoting guards against.Against a spec with
myapikey,salesapikey,keyNameandsecretPathas query parameters: