Conversation
Replace single-quote string formatting with %q format specifier to properly escape user-controlled input in error messages. This prevents potential quote injection vulnerabilities where malicious YAML key names containing single quotes could break out of the string literal. Security Impact: - Prevents potential command injection or SQL injection if error messages are used in contexts that interpret quotes specially - Follows Go best practices for safely embedding untrusted data in strings Changes: - Changed format string from '%s' to %q in validateExpressionSizes function - The %q specifier automatically escapes special characters including quotes Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
pelikhan
approved these changes
Oct 14, 2025
Contributor
Author
|
Agentic Changeset Generator triggered by this pull request |
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.
Security Fix: Unsafe Quoting in Validation Error Messages
Alert Number: #19
Severity: Critical
Rule: go/unsafe-quoting (CodeQL)
File:
pkg/workflow/validation.go:35Vulnerability Description
CodeQL identified a potentially unsafe quoting vulnerability in the
validateExpressionSizesfunction. The code was constructing an error message with user-controlled input (YAML key names) embedded directly into a single-quoted string without proper escaping:If a YAML key contains a single quote character, it could prematurely close the surrounding string literal, potentially changing the structure of the error message. While this specific instance has limited direct security impact (error messages), following secure coding practices prevents this pattern from being replicated in more sensitive contexts.
Fix Applied
Changed the format specifier from
'%s'to%qwhich properly quotes and escapes the string according to Go syntax:Security Best Practices
%qformat verb automatically escapes special characters including quotes, backslashes, and control charactersTesting Considerations
Generated with Claude Code