Skip to content

Security audit remediations (2026-08-31) - #112

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

Security audit remediations (2026-08-31)#112
cursor[bot] wants to merge 4 commits into
mainfrom
cursor/repository-security-audit-4b4b

Conversation

@cursor

@cursor cursor Bot commented Aug 31, 2026

Copy link
Copy Markdown

Summary

Weekly static security audit of envault-cli. This PR remediates High and Medium findings still open on main and replaces SECURITY_AUDIT.md with the 2026-08-31 report.

Fixed (6 High, 6 Medium):

  • Decrypt refuses to overwrite an existing file unless --force (check runs before temp files are created).
  • DynamoDB s3_key values must match encrypted/{aa}/{sha256}/{name}.encrypted.
  • Encrypt collection uses os.walk(followlinks=False) so directory symlinks are not followed.
  • migrate rejects .., per-component symlinks, and paths outside the import directory.
  • IAM: S3 object actions scoped to encrypted/*, unused ListBucket/UpdateItem removed, sts:GetCallerIdentity added; SNS topic encrypted with the envault CMK; DisableKey left available for IR.
  • rotate-key calls DescribeKey on --new-key-id before any download/decrypt.
  • ENVAULT_AUDIT_TTL_DAYS applied on encrypt/decrypt/exec/rotate-key/migrate event writes.
  • Optimistic-lock tokens use microseconds; dashboard last_activity pages until a CURRENT GSI item survives the filter.
  • exec warns when the child would inherit AWS_* credentials (--clean-env remains opt-in).
  • Encrypt output fd is closed if the SDK stream fails before fdopen.

Still open / accepted: extra target-key IAM for rotate-key (fails closed at DescribeKey); old S3 versions not a revocation primitive; no lockfile; state-index stores EVENT items; CDK L2 KMS root policy; MFA Delete is post-deploy.

Type of Change

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

Testing

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

Checklist

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

cursoragent and others added 4 commits August 31, 2026 13:17
Scope S3 object actions to encrypted/*, drop unused ListBucket and
UpdateItem, and grant sts:GetCallerIdentity so audit attribution works
under the managed policy. Encrypt the ops SNS topic with the envault CMK.
Keep kms:ScheduleKeyDeletion denied; leave DisableKey available so a
compromised key can be frozen without editing the key policy first.

Co-authored-by: Specter099 <Specter099@users.noreply.github.com>
Refuse decrypt overwrite unless --force (check before mkstemp). Bind
DynamoDB s3_key values to encrypted/{aa}/{sha256}/…. Walk trees without
following directory symlinks. Confine migrate paths to the import
directory and reject symlink components. Apply ENVAULT_AUDIT_TTL_DAYS on
every put_event path. DescribeKey the rotation target before any
plaintext exists. Warn when exec inherits AWS_* credentials. Use
microsecond CAS tokens and page dashboard last_activity past EVENT
index items. Close the encrypt output fd if the SDK stream fails.

Co-authored-by: Specter099 <Specter099@users.noreply.github.com>
Add cases for decrypt --force, untrusted S3 keys, directory-symlink
collection, migrate path confinement, DescribeKey preflight, audit TTL
on CLI flag paths, dashboard last_activity paging, and exec AWS-credential
inheritance warning. Point rotate-key tests at a moto KMS alias.

Co-authored-by: Specter099 <Specter099@users.noreply.github.com>
Replace the stale March 2026 CISO report with current findings,
remediations on this branch, and remaining low/informational items.

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