Fix critical KQL injection vulnerabilities and runtime errors in WACOA collector #1969
+247
−15
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.
The WACOA collector script had multiple KQL injection vulnerabilities allowing malicious JSON scope files or YAML definitions to execute arbitrary queries against Azure Resource Graph. Additionally, users encountered runtime errors when
settings.jsonwas missing thescriptVersionfield.Security Fixes
KQL Injection Prevention
Test-SubscriptionId(GUID format),Test-ResourceGroupName(Azure naming rules),Test-ResourceType(Provider.Service/type format)Archive Extraction Path Traversal Protection
../or..\patternsBug Fixes
Empty CurrentVersion Parameter
scriptVersioninsettings.jsonwith automatic default[AllowEmptyString()]attribute and null check inCheck-ScriptVersionCSV Header Detection
Skip 11with dynamic header line detectionUser Input Normalization
.Trim().ToLower()to all Yes/No prompts for consistent behaviorOperational Improvements
SilentlyContinuetoContinueto surface write failuresOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.