Skip to content

Potential fix for code scanning alert no. 3: Clear-text storage of sensitive information - #1

Closed
rootagi wants to merge 1 commit into
mainfrom
alert-autofix-3
Closed

Potential fix for code scanning alert no. 3: Clear-text storage of sensitive information#1
rootagi wants to merge 1 commit into
mainfrom
alert-autofix-3

Conversation

@rootagi

@rootagi rootagi commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/rootagi/eva/security/code-scanning/3

To fix this without changing behavior, add a final redaction step at the sink in src/eva/replay/recorder.py:

  • Keep existing field-level redaction (clean_command, clean_output, clean_cwd) as-is.
  • Before writing to disk, serialize the record to JSON, run redact_secrets(...) on that full line, then write the sanitized line.
  • This ensures any missed/novel secret patterns are still scrubbed even if they entered via any field, and it gives a clearer sanitizer-to-sink pattern for static analysis.

Only src/eva/replay/recorder.py needs edits, in the record_replay_event function around the current f.write(json.dumps(record) + "\n") line. No new imports or dependencies are required.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…nsitive information

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

with open(events_file, "a", encoding="utf-8") as f:
f.write(json.dumps(record) + "\n")
f.write(sanitized_record + "\n")
@rootagi

rootagi commented Aug 12, 2026

Copy link
Copy Markdown
Owner Author

This expression stores sensitive data (secret) as clear text.

@rootagi rootagi closed this Aug 12, 2026
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