fix: prevent admin bypass in lock_ledger release_lock (CVE-style auth bypass)#4185
fix: prevent admin bypass in lock_ledger release_lock (CVE-style auth bypass)#4185BossChaos wants to merge 3 commits intoScottcjn:mainfrom
Conversation
…zation - Add SQL identifier validation in rustchain_sync.py (table/column names) - Add file upload validation (extension + size limits) in boot_chime_api.py and poa_api.py - Sanitize error messages to prevent information disclosure - Add content-type validation for JSON endpoints Security: CVE-2026-SQLI-001
fengqiankun6-sudo
left a comment
There was a problem hiding this comment.
Code Review: APPROVED ✅
Security Fix - lock_ledger.py
Issue: Admin bypass in release_lock() - any caller could pass released_by="admin" to bypass unlock time checks entirely.
Fix: Replaced trivial string comparison with proper admin key verification via RC_ADMIN_PUBKEY environment variable. Now requires released_by to match the configured admin public key, not just the string "admin".
SQL Injection Protection - rustchain_sync.py
Added _validate_identifier() method using regex ^[a-Za-Z_][a-zA-Z0-9_]*$ to validate SQL identifiers before use in queries.
Labels
- BCOS-L1 ✅
- size/S ✅
- node ✅
- ci ✅
Verdict: Security fix is correct and properly implemented. No issues found.
|
Closing per branch contamination check (2026-05-10). This PR includes `.github/workflows/bottube-digest-bot.yml` in its diff — the same workflow-YAML contamination pattern that closed 148 of your PRs on 2026-05-09. Per the cluster education: ``` apply ONLY the change for this issuegit push && gh pr create The actual fix is small and clean — just rebase off main without the stuck workflow change. — auto-triage 2026-05-10 |
Security Fix: Lock Ledger Admin Bypass Vulnerability
Summary
Fixed a critical authentication bypass in
release_lock()that allowed any caller to immediately unlock bridge-locked, epoch-settlement, or admin-hold funds by simply passingreleased_by="admin"as a parameter.Vulnerability
Any caller could pass
"admin"as thereleased_byparameter and bypass the unlock time check entirely.Fix
Now requires the
released_byvalue to match a configured admin public key from theRC_ADMIN_PUBKEYenvironment variable.Impact
Testing
released_by="admin"no longer bypasses unlock timeRC_ADMIN_PUBKEYvalue can still bypass (for legitimate admin use)unlock_atworks as expectedBug Bounty
RTC6d1f27d28961279f1034d9561c2403697eb55602