fix: harden bridge API authentication bypass and add input validation#4044
fix: harden bridge API authentication bypass and add input validation#4044BossChaos wants to merge 2 commits intoScottcjn:mainfrom
Conversation
haoyousun60-create
left a comment
There was a problem hiding this comment.
Solid security fix. The implementation looks clean and addresses the vulnerability properly. LGTM! 🚀
fengqiankun6-sudo
left a comment
There was a problem hiding this comment.
PR #4044 Security Review
Summary
Hardens bridge API authentication bypass and adds input validation.
Code Assessment
- Authentication: Fixes bypass in bridge API auth
- Input Validation: Sanitizes user inputs
- Coverage: Bridge API write endpoints
Severity: CRITICAL
Auth bypass + missing input validation can lead to unauthorized actions.
Estimated RTC: 15-25
fengqiankun6-sudo
left a comment
There was a problem hiding this comment.
LGTM! Good security fix. ✅
|
Closing per branch-contamination audit (2026-05-09). This PR is part of a 161-PR cluster from your account where the diff carries files unrelated to the claimed fix. Specifically, 128 of 161 PRs in this batch modify This is a branching-hygiene problem, not a quality problem with the underlying fixes. The pattern means:
To get back to paid status:
I have nothing against the underlying fixes — quality has been good when scoped. But contamination at this scale is unreviewable, and Faucet Tiers policy requires clean diffs for security claims. Specifically clean PRs already approved for payout (per 2026-05-06 audit, still scope-clean as of today):
These will be paid via the admin /wallet/transfer flow. — auto-triage 2026-05-09 (this is mechanical contamination detection, not a personal judgment) |
Summary
Fixes critical authentication bypass and input validation gaps in
node/bridge_api.pythat could allow unauthorized bridge transfer manipulation and resource exhaustion.Critical Issues Fixed
🔴 CRITICAL: Authentication Bypass on
update-externalEndpointBefore:
If
RC_BRIDGE_API_KEYenvironment variable is not set (empty string), the authentication check is completely skipped. This means:POST /api/bridge/update-externalwithout credentialsAfter:
Now the endpoint fails closed — if the API key isn't configured, it returns 503 instead of silently accepting unauthenticated requests.
🟠 HIGH: Admin Void Endpoint Configuration Gap
The
/api/bridge/voidendpoint had the same pattern — ifRC_ADMIN_KEYwasn't set, the conditionnot expected_keywould trigger a 401, but the error message didn't indicate the root cause (missing configuration vs. wrong key).After: Explicit 503 response when admin key is not configured, with clear error message.
🟡 MEDIUM: Unlimited Query Parameter in
list_bridgesBefore:
An attacker could send
?limit=999999999to exhaust memory processing the result set.After:
Hard upper bound of 1000 results, with
ValueErrorhandling for non-numeric input.🟡 MEDIUM: Missing Bridge Amount Cap
Added a maximum bridge amount limit (1,000,000) on the
/api/bridge/initiateendpoint to prevent excessive single transfers that could drain bridge liquidity.Changes
POST /api/bridge/update-externalPOST /api/bridge/voidGET /api/bridge/listlimitparameterPOST /api/bridge/initiateTesting
py_compile)