Skip to content

fix(secrets): redact Netlify authentication token families - #185

Merged
himanshu748 merged 1 commit into
himanshu748:mainfrom
jdotc1:security/redact-netlify-tokens-20261120
Nov 22, 2026
Merged

himanshu748 merged 1 commit into
himanshu748:mainfrom
jdotc1:security/redact-netlify-tokens-20261120

Conversation

@jdotc1

@jdotc1 jdotc1 commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Security issue

Netlify authentication credentials use five typed nf* prefixes introduced in November 2023 (nfp, nfc, nfo, nfu, nfb). An unlabelled credential can otherwise enter memory without typed classification.

Change

  • Detect complete 40-character Netlify tokens (four-character prefix + 36 opaque characters) with strict identifier boundaries.
  • Add pure-Python regression tests covering all five credential families, full-span redaction, marker idempotence, malformed and embedded tokens.

The token prefixes and envelope length are from Netlify's format announcement: https://answers.netlify.com/t/change-to-the-netlify-authentication-token-format/106146

Validation

Tests are synthetic; focused pytest backend/tests/test_secrets.py and CI pending. No live credentials included.

@vercel

vercel Bot commented Nov 21, 2026

Copy link
Copy Markdown

@jdotc1 is attempting to deploy a commit to the himanshu's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b263b3dc-9645-479e-b7a2-c68eeb359619
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@himanshu748 himanshu748 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please rebase onto current main and resolve the conflict in backend/tests/test_secrets.py after #179 merged. Keep both the Netlify token cases and the overlap-scanning regression, then rerun GitHub Actions.

@jdotc1
jdotc1 force-pushed the security/redact-netlify-tokens-20261120 branch from 770cb6a to c67ee06 Compare November 21, 2026 15:30

jdotc1 commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the review by rebasing this PR's two commits onto current main (aeb323a) and resolving the conflict in backend/tests/test_secrets.py.

  • Preserved the 6,000-token mixed named/high-entropy overlap-scanning regression from fix(secrets): remove quadratic overlap scanning on dense input #179 and its optimized scanning implementation.
  • Retained the Netlify detection rule and both Netlify token-family/boundary regression tests.
  • Confirmed the PR is mergeable and the diff contains only the intended two files (32 additions, no deletions).
  • Re-ran GitHub Actions CI: backend Python 3.12: 275 passed (13 warnings); frontend lint, typecheck, and build: passed.

The separate Vercel check remains blocked by deployment authorization for the repository owner's Vercel team; it is unrelated to the code or merge-conflict resolution.

Ready for re-review.

@himanshu748 himanshu748 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The latest update still adds the Netlify tests at the same spot as the CircleCI tests merged in #178. I reproduced the Git conflict in backend/tests/test_secrets.py. Please rebase onto current main, keep both test sets, and rerun CI. Moving the Netlify cases to their own test module would also resolve the overlapping insertion.

@jdotc1
jdotc1 force-pushed the security/redact-netlify-tokens-20261120 branch from c67ee06 to e014477 Compare November 22, 2026 06:57

jdotc1 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Addressed the November 22 review by rebuilding this PR on current upstream main (581fe1ec) and force-with-lease updating the existing PR branch to e014477.

  • Moved the two Netlify credential regression tests into backend/tests/test_netlify_secrets.py, eliminating the insertion conflict in backend/tests/test_secrets.py.
  • Preserved the CircleCI tests merged in fix(secrets): redact CircleCI personal and project API tokens #178 and the 6,000-token overlap-scanning regression from fix(secrets): remove quadratic overlap scanning on dense input #179, along with all other changes on upstream main.
  • Kept detection of all five Netlify credential families with complete-token boundaries, redaction, near-miss coverage, and an additional idempotence assertion.
  • Verified the PR is mergeable and now changes only two files: the credential detector and the new Netlify-specific test module.

CI rerun passed: GitHub Actions run 44996019030.

  • Backend Python 3.12: 300 passed, 13 warnings.
  • Frontend lint, typecheck, and build: passed.
  • GitGuardian security checks: passed.

The separate Vercel authorization check remains blocked by access to the repository owner's Vercel team; this is unrelated to the patch.

Ready for re-review.

@himanshu748
himanshu748 merged commit a0e1457 into himanshu748:main Nov 22, 2026
6 of 7 checks passed
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