Commit d2f332a
Fix for code scanning alert no. 1035: Environment variable built from user-controlled sources
The concern is that the file in the artifact might be created by an attacker to inject values into the env var being set.
To address this vulnerability, we should strictly control the value of PR_NUMBER before it is written to $GITHUB_ENV. This means ensuring that:
- Only valid, single-line numeric data is used (since PR numbers are always positive integers).
- All potential for newlines, extra characters, or injection attacks is removed.
- explicitly validate that the value is non-empty and matches expectations
= Also, wrap the assignment in double quotes to further protect against expansion.
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>1 parent 9573558 commit d2f332a
1 file changed
+7
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| |||
0 commit comments