Commit b558679
fix: prevent JSON injection in static maas-api AuthPolicy X-MaaS-Group header
Replace string concatenation with proper JSON serialization in the static
maas-api AuthPolicy to prevent JSON injection vulnerabilities.
Before (vulnerable to JSON injection):
expression: '''["'' + auth.metadata.apiKeyValidation.groups.join(''","'') + ''"]'''
After (secure):
expression: string(auth.metadata.apiKeyValidation.groups)
The string() function in CEL properly serializes arrays to JSON with proper
escaping, preventing injection of malformed JSON or special characters.
This matches the fix already applied to controller-generated AuthPolicies
in commit 00db174, but the static maas-api AuthPolicy was missed.
Addresses CodeRabbit security finding (lines 463-466 comment).
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 00db174 commit b558679
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
0 commit comments