Repository navigation
fix: escape caller-supplied values in CREST query filters (IAM-11746) - #73
Merged
daveernstingFR merged 2 commits intoOct 19, 2026
Merged
Conversation
Values interpolated into CREST _queryFilter string literals were not escaped, so a crafted value could alter the filter. Added a shared escapeCrestStringLiteral helper (escapes backslashes, then quotes) and applied it at the five interpolation sites: the three OIDC app tools, getTheme, and queryESVs (which previously escaped quotes only). Tests assert the escaped filter output at the helper and tool level, including backslash and quote inputs. Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
daveernstingFR
deleted the
polaris/IAM-11746-crest-filter-injection-app-name
branch
October 19, 2026 12:27
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.
Five tools interpolated caller-supplied values directly into CREST
_queryFilterstring literals without escaping, so a crafted value couldalter the query:
getOidcApp,updateOidcApp,deleteOidcApp,getTheme, andqueryESVs.This adds a shared
escapeCrestStringLiteralhelper(
src/utils/crestHelpers.ts) — escapes backslashes, then quotes — andapplies it at all five sites.
queryESVspreviously escaped quotes only;it now uses the shared helper.
getThemeescapes its value once into alocal variable reused by both clauses of its filter.
Tool schemas, descriptions, and annotations are unchanged. Tools that
accept a caller-written filter expression by design (
listOidcApps,queryManagedObjects,queryLogs) are intentionally unchanged.Tests
test/utils/crestHelpers.test.ts): escape cases,round-trip through the CREST single-pass decode, and regression guards
(one input backslash emits exactly two; escape-once contract documented).
lookup URL for quote and backslash inputs.
escaped form.
Test plan
🤖 Generated with Claude Code