SKY-D392 · Security in code
Decoded request text in a log message
MediumCWE-117
A log or tracing message displays a decoded request string. A line break in that value can split one event across several lines in a text log.
- Languages
- Rust
- Quality gate
- counted toward the gate limits (full and diff scans)
- Finding type
- review
Why it matters
People and tools that read one event per line can mistake the extra lines for separate events.
What Skylos flags
use axum::extract::Path;pub async fn lookup(Path(name): Path<String>) { log::warn!("Unknown item {name}");}What Skylos leaves alone
use axum::extract::Path;pub async fn lookup(Path(name): Path<String>) { log::warn!("Unknown item {name:?}");}Why Skylos leaves it alone
Rust's debug format escapes line breaks in this String.
How Skylos decides
- Skylos follows string values from recognized decoded HTTP extractors into log and tracing message templates. It checks captured names, named arguments and positional arguments that use the default display format.
- Structured fields and debug-formatted strings have different rendering rules. An HTTP URI's raw query string keeps its percent encoding. These cases stay quiet.
How to fix it
Escape line breaks before writing a text log. For a String, debug formatting escapes control characters. A structured logging backend can also encode each field as data.
When it can be wrong
- A deployed log formatter may already encode the entire message as one JSON string. The scanner cannot see the backend's runtime configuration.
Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.
How to silence it
Use
// skylos: ignore[SKY-D392]with the reason on a reviewed call.