security: redact leaked GitHub PAT, tighten .gitignore, pin Flask deps#54
Open
racmac57 wants to merge 1 commit into
Open
security: redact leaked GitHub PAT, tighten .gitignore, pin Flask deps#54racmac57 wants to merge 1 commit into
racmac57 wants to merge 1 commit into
Conversation
The token has been revoked on github.com/settings/tokens by the repo
owner. This commit removes the plaintext from HEAD and prevents
recurrence. Git history was intentionally NOT rewritten — see
docs/DEPENDENCY_AUDIT.md for rationale.
Changes:
- Redacted 6 occurrences of the same revoked PAT (ghp_OtOOLx…) across:
source/2025_10_28_23_19_14_2025_10_28_22_11_53_claude_chat_chunker_chunk17.txt
99_doc/legacy/ClaudeExportFixer_20251029_215403/cursor_create_python_cli_project_struct.md
Replaced with literal "<REDACTED-GITHUB-PAT>".
- .gitignore: added secret-file patterns (.env, *.pem, credentials.json,
service_account*.json, .aws/, .gcp/, .azure/, .pypirc, .netrc, …) and
AI chat-export patterns (*_chat_chunker_chunk*.txt, cursor_*.md) so
future exports can't be committed accidentally. Existing tracked
chunk files in source/ are not affected — gitignore only filters
newly-added paths.
- grok_review_package/Dependencies/requirements.txt: switched from
exact pins (==X.Y.Z) to range pins (>=X.Y.Z,<MAJOR+1) so Dependabot's
patch/minor auto-merge (added in PR #43) can apply security patches
without manual edits. Floor on Flask raised to >=3.1.1; Flask 3.1.0
already patched the two CVEs called out in the task brief
(CVE-2023-30861 'Vary: Cookie' fixed in 2.2.5/2.3.2; fallback session
key fixed in 3.0).
- docs/DEPENDENCY_AUDIT.md: new file documenting what was checked,
what was deliberately NOT done (history rewrite, speculative CVE
claims), and recommended follow-ups (live pip-audit in CI, GitHub
Push Protection).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the security checklist from the chat:
Flask==3.1.0already patched both; bumped floor to>=3.1.1.gitignoreto prevent future secret commitsdocs/DEPENDENCY_AUDIT.mdThe owner has already revoked the token on github.com/settings/tokens. Git history was deliberately NOT rewritten — once the token is revoked, history rewrite gives marginal benefit and would have invalidated open PRs #52, #53 plus every existing clone. See
docs/DEPENDENCY_AUDIT.mdfor the full rationale.What's in the diff
1. Token redaction (6 occurrences, 1 unique token, 2 files):
source/2025_10_28_23_19_14_2025_10_28_22_11_53_claude_chat_chunker_chunk17.txt99_doc/legacy/ClaudeExportFixer_20251029_215403/cursor_create_python_cli_project_struct.mdThe 40-character
ghp_…strings are replaced with the literal<REDACTED-GITHUB-PAT>.2.
.gitignoreadditions — secret-prone file patterns:.env,.env.*(with!.env.exampleallowlist)*.pem,*.key,*.p12,*.pfxcredentials.json,client_secret*.json,service_account*.json,*_credentials.json.netrc,.pypircsecrets.{yml,yaml,toml}.aws/,.gcp/,.azure/chat_export*.{txt,md},*_chat_chunker_chunk*.txt,cursor_*.mdAlready-tracked chunk files in
source/are unaffected — gitignore only filters newly-added paths.3.
grok_review_package/Dependencies/requirements.txt— switched from exact pins (==X.Y.Z) to range pins (>=X.Y.Z,<MAJOR+1). Lets Dependabot's existing patch/minor auto-merge (from PR #43) apply future security patches without manual edits. Header comment + Flask block carry inline notes about the CVEs.4.
docs/DEPENDENCY_AUDIT.md— new doc capturing what was checked, what was deliberately not done, and follow-ups (livepip-auditin CI, GitHub Push Protection).Honest limitations
gunicorn,eventlet, andscikit-learnto specific "fixed-in" versions citing CVE IDs I couldn't verify; those speculative claims were stripped out before commit. Runpip-audit -r grok_review_package/Dependencies/requirements.txtlocally to confirm/refute.git log -p. Mitigated only by the revocation, which is done.Test plan
ruff check .→All checks passed!pytest tests/test_smoke.py→ 3 passedgrep -rE "ghp_[A-Za-z0-9]{36}|AKIA[A-Z0-9]{16}" --exclude-dir=.git .→ no matches.gitignorerules verified to catch new chunk-style files but leave tracked ones alonetest-fastgreenFollow-ups (not in this PR)
pip-auditstep to.github/workflows/ci.ymlso dependency CVEs fail PRs at merge time.gitleaksortrufflehogpre-commit hook for local pre-push catches.Generated by Claude Code