Commit 47d964d
committed
fix: sanitize logged values in AreaPolygonService to prevent log forging
Replace logging of the user-influenced Position object with explicit
numeric X/Y/Z coordinates and a sanitized task id. This addresses
CodeQL alert cs/log-forging (CWE-117) where untrusted input from the
custom mission endpoint could flow into log entries and forge new
lines.
Also make Sanitize.SanitizeUserInput null-safe by accepting a nullable
string and returning string.Empty for null input rather than throwing
NullReferenceException, removing a sharp edge for current and future
callers.
Closes #123 (code-scanning alert)1 parent 80bf7d1 commit 47d964d
2 files changed
Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
0 commit comments