Commit 9e885fc
fix(security): resolve CodeQL & zizmor code-scanning alerts (#18)
* fix(security): resolve CodeQL/zizmor code-scanning alerts
- env_utils: replace fragile `find(...) != 0` scheme check with the
anchored `rfind(prefix, 0) == 0` idiom in validate_url_env (hardens
the prefix match; CodeQL #1 is a false positive — env-var config
validation, not an authentication barrier — dismissed separately).
- ci.yml: drop workflow-level `security-events: write`; grant it only to
the `gates` job that runs CodeQL (zizmor excessive-permissions #7).
- security.yml: pin the org reusable security-scan.yml to a commit SHA
(zizmor unpinned-uses #5), matching ci.yml's existing convention.
- add .github/zizmor.yml documenting intentional ignores: secrets-inherit
on first-party org reusable callers (#6, #8) and template-injection in
gh-aw generated workflow files (#11-20, DO NOT EDIT / maintainer vars).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor(env_utils): use strncmp for allocation-free scheme check
Address review feedback: check the http(s):// prefix directly on the
const char* with std::strncmp instead of constructing a std::string,
avoiding an unnecessary heap allocation. strncmp stops at the NUL
terminator, so short values remain safe.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 33f730b commit 9e885fc
4 files changed
Lines changed: 42 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | | - | |
21 | | - | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
29 | 34 | | |
30 | 35 | | |
31 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
144 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
145 | 150 | | |
146 | 151 | | |
147 | 152 | | |
| |||
0 commit comments