fix(web): resolve false-positive js/insufficient-password-hash CodeQL alert#1435
Draft
linear-code[bot] wants to merge 2 commits into
Draft
Conversation
… cache key
CodeQL's sensitive-data heuristic classifies any identifier containing
"oauth" as a password, so the requested OAuth scopes flowing into
createHash('sha256') tripped js/insufficient-password-hash. These scopes
are not secret; the hash only produced a cache-key segment. Replace it
with a base64url encoding of the normalized scope list, which is
deterministic, delimiter-safe, and not a cryptographic operation.
Generated with [Linear](https://linear.app/sourcebot/issue/SOU-1495/sourcebot-devsourcebot-codeqljsinsufficient-password-hash-high#agent-session-424c6dc8)
Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
Generated with [Linear](https://linear.app/sourcebot/issue/SOU-1495/sourcebot-devsourcebot-codeqljsinsufficient-password-hash-high#agent-session-424c6dc8) Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes SOU-1495
CodeQL's sensitive-data heuristic classifies any identifier containing
oauthas a password. As a result,requestedOAuthScopesflowing intocreateHash('sha256')ingetMcpListToolsCacheKeytrippedjs/insufficient-password-hash(HIGH). This is a false positive: the OAuth scope strings are not secret, and the hash was only used to build a per-scope segment of the Redis cache key for MCP tool-list results.Rather than suppress the alert (GitHub's default CodeQL setup doesn't honor inline suppression comments), this removes the cryptographic operation entirely. The scope segment is now derived by base64url-encoding the normalized (deduped, sorted) scope list, which is deterministic, collision-free, and delimiter-safe (
:is the cache-key delimiter). Since it's no longer aCryptographicOperation, the rule can't fire regardless of the misclassification.Existing
mcpToolSetstests pass; they assert the cache-key prefix and don't depend on the scope segment's exact value.