-
Notifications
You must be signed in to change notification settings - Fork 36
[Custom Engine Test] Test Pull Request - Custom Engine Safe Output #538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
github-actions
wants to merge
1
commit into
main
from
test-safe-outputs-custom-engine/a81b87f99e72883d
Closed
[Custom Engine Test] Test Pull Request - Custom Engine Safe Output #538
github-actions
wants to merge
1
commit into
main
from
test-safe-outputs-custom-engine/a81b87f99e72883d
Conversation
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
github-actions bot
pushed a commit
that referenced
this pull request
Jan 22, 2026
- Add proper shell escaping for JSON data embedded in environment variables - Prevents potential command injection via single quotes in user data - Fixes CodeQL alert #538 (Critical severity) - Uses POSIX-compatible '\''escaping technique Security: Addresses CWE-78, CWE-89, CWE-94
pelikhan
added a commit
that referenced
this pull request
Jan 22, 2026
…ON data (#11382) * Fix go/unsafe-quoting: Escape single quotes in JSON data - Add proper shell escaping for JSON data embedded in environment variables - Prevents potential command injection via single quotes in user data - Fixes CodeQL alert #538 (Critical severity) - Uses POSIX-compatible '\''escaping technique Security: Addresses CWE-78, CWE-89, CWE-94 * Replace manual quote escaping with %q format specifier (#11386) * Initial plan * Use %q for JSON escaping in YAML dictionary values Replaced manual single-quote escaping with Go's %q format specifier, which: - Automatically handles all special characters and escaping - Produces cleaner YAML with double quotes instead of single quotes - Follows existing codebase patterns (e.g., add_comment.go) - Simplifies code by removing manual string replacement logic This addresses the feedback to use simpler escaping for JSON data in YAML dictionary values. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * Replace manual quote escaping with %q format specifier for YAML encoding (#11392) * Initial plan * Recompile workflows after security fix Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * Add changeset [skip-ci] --------- Co-authored-by: Code Scanning Fixer Bot <code-scanning-bot@github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
github-actions bot
added a commit
that referenced
this pull request
Jan 22, 2026
…ection Fixes code scanning alert #538 - Potentially unsafe quoting (go/unsafe-quoting) **Security Fix**: Replace %q string formatting with base64 encoding for JSON data passed via environment variables to eliminate quote-escaping vulnerabilities. **Root Cause**: The previous implementation used Go's %q format specifier to quote JSON data containing project views configuration. While %q provides backslash escaping, it doesn't fully protect against quote injection if the value is used unsafely in downstream shell commands or SQL queries. **Solution**: Encode the JSON data as base64 before passing it via the GH_AW_PROJECT_VIEWS environment variable. Base64 encoding ensures the value contains only alphanumeric characters and safe symbols (+, /, =), completely eliminating the risk of quote-breaking characters. **Impact**: This is a preventive fix - the environment variable is not currently consumed by JavaScript code, so there is no breaking change. When the JavaScript code is implemented to read this variable, it will need to base64-decode the value before parsing as JSON. **Security Best Practice**: Base64 encoding is the most robust solution for passing arbitrary data through environment variables, as recommended by security experts for preventing injection attacks. Related: CWE-78, CWE-89, CWE-94
pelikhan
added a commit
that referenced
this pull request
Jan 22, 2026
…_VIEWS (#11401) * fix: use base64 encoding for GH_AW_PROJECT_VIEWS to prevent quote injection Fixes code scanning alert #538 - Potentially unsafe quoting (go/unsafe-quoting) **Security Fix**: Replace %q string formatting with base64 encoding for JSON data passed via environment variables to eliminate quote-escaping vulnerabilities. **Root Cause**: The previous implementation used Go's %q format specifier to quote JSON data containing project views configuration. While %q provides backslash escaping, it doesn't fully protect against quote injection if the value is used unsafely in downstream shell commands or SQL queries. **Solution**: Encode the JSON data as base64 before passing it via the GH_AW_PROJECT_VIEWS environment variable. Base64 encoding ensures the value contains only alphanumeric characters and safe symbols (+, /, =), completely eliminating the risk of quote-breaking characters. **Impact**: This is a preventive fix - the environment variable is not currently consumed by JavaScript code, so there is no breaking change. When the JavaScript code is implemented to read this variable, it will need to base64-decode the value before parsing as JSON. **Security Best Practice**: Base64 encoding is the most robust solution for passing arbitrary data through environment variables, as recommended by security experts for preventing injection attacks. Related: CWE-78, CWE-89, CWE-94 * Replace base64 encoding with %q formatting and add CodeQL suppression (#11402) * Initial plan * fix: replace base64 encoding with %q formatting and add CodeQL suppression Replace unnecessary base64 encoding with standard %q formatting for GH_AW_PROJECT_VIEWS environment variable. The original security concern was invalid - this code generates YAML environment variable declarations, not shell scripts, so there is no shell injection risk. Added lgtm[go/unsafe-quoting] suppression comment explaining that %q is safe in this context because the value is set as a YAML environment variable, not executed as shell code. Addresses review feedback in #11401. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --------- Co-authored-by: GitHub Actions Bot <github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
github-actions bot
added a commit
that referenced
this pull request
Jan 22, 2026
Fixes code scanning alert #538 (CWE-78, CWE-89, CWE-94) Changes: - Replace %q format with base64 encoding for GH_AW_PROJECT_VIEWS - Add comprehensive tests for base64 encoding with special characters - Add security tests to verify injection prevention This eliminates the unsafe quoting vulnerability by encoding JSON data as base64, which contains only alphanumeric and safe characters. Even if the value is misused in shell contexts, it cannot cause injection attacks.
github-actions bot
pushed a commit
that referenced
this pull request
Jan 23, 2026
…oting Fixes code scanning alert #538 (go/unsafe-quoting) The code was creating a GH_AW_PROJECT_VIEWS environment variable with JSON data embedded using %q, which CodeQL flagged as unsafe quoting. However, this environment variable was never consumed by any JavaScript code - it was dead code. The actual views configuration is properly passed through the GH_AW_SAFE_OUTPUTS_PROJECT_HANDLER_CONFIG environment variable (see compiler_safe_outputs_config.go:602-608), which uses proper JSON marshaling and %q escaping on line 638. This fix removes the unused code entirely, eliminating the security vulnerability without affecting functionality. CWE-78, CWE-89, CWE-94
This was referenced Jan 23, 2026
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.
Test Pull Request - Custom Engine Safe Output
This pull request was automatically created by the test-safe-outputs-custom-engine workflow to validate the create-pull-request safe output functionality.
Changes Made
Test Information
This PR can be merged or closed after verification of the safe output functionality.