Commit a8da034
fix(security): resolve remaining 2 CodeQL alerts (#440, #441) (#136)
Address the two CodeQL alerts that persisted after PR #133 because the
fixes there were not recognised by CodeQL's static analysis:
- #441 py/log-injection in services/api/app/api/v1/endpoints/waitlist.py:
the `_log_safe` helper was not detected as a sanitiser when the value
came from a database row. Inline the `.replace("\\r","").replace("\\n"," ")`
chain with a 32-char cap at the `logger.info` call site so the taint
tracker sees the cleansing directly. The now-unused `_log_safe` helper
has been removed.
- #440 py/import-and-import-from in
services/connectors/tests/connectors/test_confluence_audit.py: the
previous module alias still tripped the rule. Drop the alias entirely
and switch the `_PAGE_SIZE` override to `pytest.MonkeyPatch.setattr`,
giving a single import style and automatic restoration at teardown.
Both values in waitlist are also Pydantic-validated against
ALLOWED_WAITLIST_STATUSES, so this is defence in depth, not a behaviour
change.
Co-authored-by: Beenu Arora <[email protected]>1 parent 424a095 commit a8da034
2 files changed
Lines changed: 19 additions & 29 deletions
File tree
- services
- api/app/api/v1/endpoints
- connectors/tests/connectors
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | 203 | | |
220 | 204 | | |
221 | 205 | | |
| |||
436 | 420 | | |
437 | 421 | | |
438 | 422 | | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
439 | 430 | | |
440 | 431 | | |
441 | 432 | | |
442 | 433 | | |
443 | | - | |
444 | | - | |
| 434 | + | |
| 435 | + | |
445 | 436 | | |
446 | 437 | | |
447 | 438 | | |
| |||
Lines changed: 10 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
78 | 77 | | |
79 | 78 | | |
80 | 79 | | |
81 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
| |||
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
106 | 105 | | |
107 | 106 | | |
108 | 107 | | |
| |||
0 commit comments