Skip to content

fix: weekly security audit remediations (2026-08-17) - #111

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/repository-security-audit-c743
Draft

fix: weekly security audit remediations (2026-08-17)#111
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/repository-security-audit-c743

Conversation

@cursor

@cursor cursor Bot commented Aug 17, 2026

Copy link
Copy Markdown

Summary

Weekly static security audit of envault-cli. Prior Critical decrypt-path issues (plaintext-before-verify, no streaming) were already fixed on main. This PR closes the remaining High/Medium items that were still open and replaces the stale in-tree CISO report.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Chore / maintenance

What changed

CLI / crypto orchestration

  • decrypt refuses to overwrite an existing destination unless --force (check runs before mkstemp).
  • _collect_files no longer follows directory symlinks (os.walk(followlinks=False)).
  • DynamoDB s3_key values must match encrypted/{aa}/{sha256}/{name}.encrypted before GetObject.
  • rotate-key calls DescribeKey on --new-key-id before any download/decrypt.
  • ENVAULT_AUDIT_TTL_DAYS is applied on encrypt, decrypt, exec, rotate-key, and migrate event writes.
  • migrate rejects absolute paths and symlinks, not only .. components.
  • exec warns when the child would inherit AWS_* credentials (--clean-env remains opt-in).

State

  • Dashboard last_activity pages until a CURRENT item survives the GSI filter (no Limit=1 before FilterExpression).
  • Optimistic-lock timestamps use microseconds.

IAM / KMS

  • kms:DisableKey removed from the key-policy deny (incident response); ScheduleKeyDeletion stays denied.
  • Unused dynamodb:UpdateItem and s3:ListBucket dropped; object actions scoped to encrypted/*.
  • sts:GetCallerIdentity granted so audit events can record a principal.

Docs / CI

  • SECURITY_AUDIT.md rewritten for this week (residual risk documented).
  • README: --force, rotate-key extra-key IAM, 365-day noncurrent versions, --clean-env.
  • pip-audit CVE ignores now have justifications.

Remaining (not in this PR)

  • rotate-key still needs a separate IAM grant for a non-stack CMK (CLI now fails closed at preflight).
  • Rotation is not revocation: noncurrent S3 versions stay for 365 days under the old key.
  • state-index hot partition / event bloat needs a GSI migration.
  • No lockfile; --clean-env default would be a breaking change.

Testing

  • ruff check / ruff format --check / mypy src/envault/ — clean
  • pytest tests/unit/177 passed

Checklist

  • Self-reviewed the diff
  • Added / updated tests
  • Updated documentation if needed
  • CI passes
Open in Web View Automation 

cursoragent and others added 2 commits August 17, 2026 13:14
Refuse decrypt overwrites without --force, skip directory-symlink trees,
validate DynamoDB S3 keys against the encrypted/ prefix, and fail rotate-key
on DescribeKey before any plaintext temp is written. Honor ENVAULT_AUDIT_TTL_DAYS
on every event write, reject absolute/symlink migrate paths, and warn when
exec inherits AWS credentials.

Dashboard last_activity pages past EVENT GSI hits instead of Limit=1; CAS
tokens use microsecond timestamps. The managed policy drops unused UpdateItem
and ListBucket, scopes objects to encrypted/*, grants sts:GetCallerIdentity,
and no longer denies kms:DisableKey.

Co-authored-by: Specter099 <Specter099@users.noreply.github.com>
Replace the stale CISO review (which described already-fixed decrypt-path
bugs) with this week's findings. Document rotate-key extra-key IAM, the
365-day noncurrent-version window, decrypt --force, and ENVAULT_* in
.env.example.

Co-authored-by: Specter099 <Specter099@users.noreply.github.com>
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