fix: address CodeQL static analysis findings in JS/TS#2390
Open
yonib05 wants to merge 1 commit into
Open
Conversation
Contributor
|
Assessment: Approve Well-scoped set of targeted fixes for CodeQL findings. Each change is minimal, correct, and improves the security/robustness posture without behavioral regressions. Review Notes
The "not addressed" section in the PR description is appreciated — clear reasoning for why certain findings are false positives or require deeper investigation. |
- Replace Math.random() with crypto.randomUUID() for session IDs in bedrock agentcore example - Add data: and vbscript: to URL scheme blocklist in link checker, normalize case before comparison - Set Content-Type header on NDJSON streaming response in example - Rewrite markdown link regex to avoid catastrophic backtracking - Fix double-escaping in context-offloader search: only escape regex metacharacters in the catch path, not preemptively on truncation
Contributor
Documentation Preview ReadyYour documentation preview has been successfully deployed! Preview URL: https://d3ehv1nix5p99z.cloudfront.net/pr-cms-2390/docs/user-guide/quickstart/overview/ Updated at: 2026-05-29T19:37:43.432Z |
cf74698 to
6f97fdd
Compare
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.
Summary
Math.random()withcrypto.randomUUID()for session ID generation in bedrock agentcore exampledata:andvbscript:to URL scheme blocklist in link checker; normalize to lowercase before comparisonContent-Type: application/x-ndjsonheader on streaming response in async-iterators exampleupdate-docs.test.tsto avoid catastrophic backtracking (uses(?:[^\[\]]|\[[^\]]*\])*instead of nested[^\]]*groups)search.ts: only escape regex metacharacters in the catch fallback path, not preemptively on truncationTest plan
site/test/update-docs.test.tstests still pass