Skip to content

Triage CodeQL rust/cleartext-logging alerts #11–#14 - #148

Merged
joshuaboys merged 2 commits into
mainfrom
cursor/codeql-cleartext-logging-triage-526f
Sep 7, 2026
Merged

joshuaboys merged 2 commits into
mainfrom
cursor/codeql-cleartext-logging-triage-526f

Conversation

@joshuaboys

Copy link
Copy Markdown
Contributor

Summary

Triage of open CodeQL rust/cleartext-logging alerts #11–#14. All four are false positives: taint analysis does not treat kindling’s secret maskers as sanitizers, so already-redacted strings look like cleartext when they hit assert! / println!.

No production leak. KindlingService::append_observation always runs mask_secrets_with_evidence on both the validated and validate: false paths (in-process CLI and daemon). Hook capture runs mask_secrets / filter_content before append, then the service masks again.

Alert dispositions (please dismiss)

Alert Site Proposed dismissal Rationale
#11 crates/kindling/src/hook/filter.rs:275 used in tests Unit test secret_assignment_is_masked. Interpolated filter_content → mask_secrets output into an assert message. Test no longer interpolates that string.
#12 same file :276 used in tests Same test, second assert.
#13 crates/kindling/tests/capture_mapping.rs:84 used in tests Fixture is $ boom + default "Unknown error" — no secrets. Assert no longer interpolates obs.content.
#14 crates/kindling/src/commands/log.rs:103 false positive: redacted before write CLI human output prints observation.content after append_observation, which always calls mask_secrets_with_evidence. CodeQL sees taint through the masker. Productive path: user asked to log this content; we echo the stored (already-masked) row.

Inline // codeql[…] suppressions were not added.

What changed

  • CodeQL model pack at .github/codeql/extensions/kindling-rust/ marks mask_secrets / mask_secrets_with_evidence as log-injection barriers (the sink kind rust/cleartext-logging uses). GitHub default setup auto-detects packs under that directory.
  • SECURITY.md: automated-scanning section with this table (next to the existing secret-scanning fixture note).
  • Tests: stop using masked/fixture strings as assert format args; add cli_log_echoes_already_redacted_content so the fix: DX hardening - security, error handling, docs #14 path stays pinned.
  • Short comments on the maskers and the CLI echo.

How the maskers work

mask_secrets / mask_secrets_with_evidence (crates/kindling-service/src/filter/secrets.rs, hook copy in crates/kindling/src/hook/filter.rs) walk the secret-pattern list and replace matches with [REDACTED] or key=[REDACTED]. Evidence classes never include matched substrings. Service tests already pin api_key=abcdef123456789 → api_key=[REDACTED].

Test plan

  • cargo test -p eddacraft-kindling --lib secret_assignment_is_masked
  • cargo test -p eddacraft-kindling --test capture_mapping
  • cargo test -p eddacraft-kindling --test umbrella cli_log
  • cargo test -p kindling-service append_observation_masks_secrets
Open in Web Open in Cursor 

cursoragent and others added 2 commits September 7, 2026 05:14
Service-boundary and hook maskers already redact before any write. CodeQL
taint-tracks through those functions into assert!/println! sinks.

Teach the analyzer via a log-injection barrier model, document dismissals
in SECURITY.md, and stop interpolating already-masked strings in tests.

Co-authored-by: Josh Boys <josh@arkahna.io>
Co-authored-by: Josh Boys <josh@arkahna.io>
@joshuaboys
joshuaboys marked this pull request as ready for review September 7, 2026 05:15
@joshuaboys
joshuaboys merged commit 50dec01 into main Sep 7, 2026
26 checks passed
@joshuaboys
joshuaboys deleted the cursor/codeql-cleartext-logging-triage-526f branch September 7, 2026 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants