Skip to content

fix(varlock): register numeric @sensitive values for leak scanning - #7

Closed
WalksWithASwagger wants to merge 1 commit into
mainfrom
cursor/fix-sensitive-number-redaction-21b2
Closed

fix(varlock): register numeric @sensitive values for leak scanning#7
WalksWithASwagger wants to merge 1 commit into
mainfrom
cursor/fix-sensitive-number-redaction-21b2

Conversation

@WalksWithASwagger

Copy link
Copy Markdown
Owner

Summary

@type=number @sensitive values (e.g. PINs) were injected into process.env as strings but never registered in the redaction/leak map, so scanForLeaks and log redaction silently ignored them.

Changes

  • Collect finite numbers (including nested array/object elements) in collectSensitiveStrings
  • Stop skipping sensitive 0 via a falsy !item.value check
  • Pretty-print redacts numeric sensitive values too
  • Booleans intentionally not registered ("true"/"false" would false-positive everywhere)

Test plan

  • bunx vitest run src/runtime/test/scan-for-leaks.test.ts
  • Maintainer: confirm numeric PIN in a response body is blocked

To open against upstream: https://github.com/dmno-dev/varlock/compare/main...WalksWithASwagger:varlock:cursor/fix-sensitive-number-redaction-21b2?expand=1

Open in Web Open in Cursor 

Finite numbers (and nested numeric elements) are now collected into the
redaction/leak map, and sensitive 0 is no longer skipped by a falsy check.
Pretty output also redacts numeric sensitive values.
@github-actions

Copy link
Copy Markdown

bumpy-frog

The changes in this PR will be included in the next version bump.

minor Minor releases

  • varlock 1.14.1 → 1.15.0

patch Patch releases

  • @varlock/1password-plugin 2.0.2 → 2.0.3
  • env-spec-language 0.3.1 → 0.3.2

Bump files in this PR

Click here if you want to add another bump file to this PR


This comment is maintained by bumpy.

@github-actions

Copy link
Copy Markdown

📦 Bundle size

⚠️ grows the bundle by 217.9 KB (+4.6%)

Metric main This PR Δ
Total dist 4717.9 KB 4935.7 KB +217.9 KB (+4.6%)
JS 1631.7 KB 1696.4 KB +64.8 KB (+4.0%)
Sourcemaps 3016.9 KB 3163.3 KB +146.3 KB (+4.9%)
Type defs 69.3 KB 76.0 KB +6.8 KB (+9.8%)

dist/ only; native binaries are versioned separately and not counted here.

@WalksWithASwagger

Copy link
Copy Markdown
Owner Author

Superseded by #17, which rebases the still-valid expedition fixes onto current dmno-dev/varlock main.

This specific change (registering numeric @sensitive values for leak scanning) was not re-landed: upstream dmno-dev#1054 now treats numbers as unredactable by design and reports them instead. Display redaction already goes through redactSensitiveDisplayValue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant