fix(security): avoid disclosing raw error details in bedrock RewriteGenerator [ACT-3522]#11055
Closed
Tyler (tylerwashington888) wants to merge 2 commits into
Closed
fix(security): avoid disclosing raw error details in bedrock RewriteGenerator [ACT-3522]#11055Tyler (tylerwashington888) wants to merge 2 commits into
Tyler (tylerwashington888) wants to merge 2 commits into
Conversation
Replace console.error(error) with a sanitized message to prevent stack traces and raw error internals from leaking through the console in the bedrock RewriteGenerator component. Addresses Wiz SAST finding WS-I002-JAVASCRIPT-00027 (CWE-209, critical severity). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
Superseded by consolidated PR #11057. |
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.
Purpose
Remediate Wiz SAST critical finding WS-I002-JAVASCRIPT-00027 (CWE-209 — Disclosure of Error Details and Stack Traces) in the bedrock RewriteGenerator component. The raw error object was being passed directly to
console.error(), which can expose internal stack traces and error internals in production logs.Approach
Single-line change to line 58 of
apps/bedrock-content-generator/src/components/app/dialog/rewrite-generator/RewriteGenerator.tsx.Wiz remediation guidance (quoted):
Before (lines 57–59):
After:
No other lines or files were touched. The catch block still handles the error path; it simply no longer forwards the raw error object to the console.
Testing steps
An error occurred. Please try again.rather than a raw error object or stack trace.Breaking Changes
None. This is a purely logging-level change — the error is still caught and handled; only the console output is sanitized.
Dependencies and/or References
Deployment
No deployment concerns. This is a client-side logging change only.