You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stable gas price error logging leaks the full URL, query string included #384
From the external review of #374. Verified here, and the mechanism is slightly
different from the report.
The review says the stable gas price source logs its full URL on error. It does,
but indirectly — which matters, because grepping for {url} in stable_gas_price.rs finds nothing:
crates/cli/src/https.rs:219 attaches the full URL as anyhow context: .with_context(|| format!("fetching {url}"))
crates/cli/src/stable_gas_price.rs:318 logs the whole chain: error!(target: "rustock::mining", "Error getting min gas price from web provider: {e:#}")
{e:#} prints every context layer, so the URL — including its query string —
reaches the log. node.example.toml documents the source URL as taking query
parameters (?ids=bitcoin&vs_currencies=usd), and a paid price API typically
carries the key there.
This goes against our no-full-URL-logging rule, which exists precisely because
secrets live in query strings.
Scope
The production node does not mine, and [mining.stable_gas_price] defaults
to enabled = false, so nothing logs this today. It is a trap for whoever turns
it on.
What would settle it
Log scheme + host only, as public_ip.rs already does with host_of(url) — that
helper exists and solves exactly this. Either reuse it, or drop the URL from the
anyhow context and let the caller name the host.
Activity