Skip to content

Harden untrusted input and sensitive data handling#127

Merged
brucehart merged 11 commits into
mainfrom
feature/security-hardening
Jul 13, 2026
Merged

Harden untrusted input and sensitive data handling#127
brucehart merged 11 commits into
mainfrom
feature/security-hardening

Conversation

@brucehart

Copy link
Copy Markdown
Owner

Summary

  • Fix seven security findings involving external blob paths, sensitive-data remnants, plugin execution, vulnerable dependencies, replay redirects, compressed HAR expansion, and CSV formula injection.

Changes

  • Deny external blob reads and deletions by default, with canonical root confinement when explicitly enabled.
  • Copy SQLite databases through the online backup API and securely remove orphaned blobs, free-page data, and WAL remnants after redaction or PII rewriting.
  • Require explicit --plugin authorization for configured executables and disable automatic replay redirects.
  • Cap decompressed HAR input at 512 MiB, bound asynchronous read-ahead, and neutralize formula-leading CSV fields.
  • Upgrade vulnerable Rust dependencies, adapt Parquet export to the current writer API, and add all-feature CI plus dependency auditing.
  • Add exploit-focused regression tests and update CLI documentation.

Testing

  • cargo test --all-features --locked passed: 60 library tests, 60 binary tests, and 76 integration tests.
  • cargo audit reported zero known vulnerabilities; three informational unmaintained-package warnings remain.
  • cargo clippy --all-features --all-targets --locked completed successfully with existing non-blocking warnings.
  • git diff --check passed.

Notes

  • Configured plugins now require --plugin <name> on every run.
  • Replay no longer follows redirects automatically.
  • External bodies require --allow-external-paths and can be confined with --external-path-root.

Confine external blob access, sanitize redacted databases, and require explicit plugin authorization.

Bound HAR parsing, prevent replay redirect leaks and CSV formula injection, update vulnerable dependencies, restore Parquet support, and add security regression tests plus CI auditing.
@brucehart

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 935ab6c5da

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/commands/prune.rs
@brucehart

Copy link
Copy Markdown
Owner Author

Addressed the actionable P2 review feedback in stacked PR #128: #128

The fix removes matching graphql_fields rows before deleting their parent entries under foreign-key enforcement, retains compatibility with databases without that table, and adds a regression test. Validation: cargo test --all-features --locked (196 tests passed) and git diff --check.

Stage output database copies until redaction completes so failures preserve any existing destination. Wrap PII entry rewrites in a single transaction, defer prune filesystem deletion until after commit, and retain external files still referenced by surviving blobs. Add regressions for rollback, publication failure, overwrite, and shared external paths.
Propagate SQLite decoding errors while protecting surviving external blob paths so malformed databases roll back before filesystem deletion. Clean rollback-journal sidecars with staged databases and add regressions for both cases.
Back up an existing destination database and its SQLite sidecars as a recoverable set before publishing staged output. Move orphaned-blob cleanup into the PII and redact transactions so cleanup errors roll back every logical rewrite. Add restore, replacement, and cleanup-failure regressions.
Simulate a failed final rename and verify the prior destination database and every SQLite sidecar are restored without leaving a backup directory.
Propagate malformed entry hashes, orphan blob hashes, and pruned external paths instead of silently skipping them. Add regressions proving malformed pruned paths and entry hashes roll back the import transaction.
Fail closed on every prune row decode
Fail closed on malformed prune paths
Make sensitive rewrites and prune cleanup atomic
Fix GraphQL field pruning under foreign keys
@brucehart
brucehart merged commit 1df844e into main Jul 13, 2026
4 checks passed
@brucehart
brucehart deleted the feature/security-hardening branch July 13, 2026 21:56
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.

1 participant