Refs #576: Reject control chars in payout notes#627
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR adjusts note field validation in the bounty payout API. Control-character validation now runs against the raw input before whitespace stripping, and the note is included in the result only if the stripped value is non-empty. The security test is expanded to parameterized form, covering multiple control-character cases. ChangesNote Field Validation
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
barnacleagent-svg
left a comment
There was a problem hiding this comment.
PR Review — #627
PR: #627
Author: @xingxi0614-cpu
Head SHA: 365095e
Files Changed (2 files)
- : Moved control-char check before strip() so raw note is checked, not trimmed note
- : Parametrized test to cover
, , and � control chars
CI Status
Quality/readiness/docs/image checks: completed/success
Code Review
- Fix is correct: checking raw_note before strip() ensures tab/� at start/end are caught
- Parameterized test cleanly covers all three control patterns
- No side effects, no stale references
Verdict
APPROVE — Ready for merge.
|
Reviewed current head Verdict: no blocker found in this slice. Evidence checked:
I did not run local tests in this automation pass because the hourly loop is currently avoiding package/test execution unless strictly necessary. No private data, secrets, admin token values, wallet material, production mutation, signing, transfers, price/liquidity/exchange/bridge/off-ramp claims, or fabricated payout claims were used. |
Jorel97
left a comment
There was a problem hiding this comment.
Reviewed current head 365095e9a9d2dc73eafb5bf83354ce0f64b1301c as a non-author.
Evidence checked:
- Inspected
app/bounty_api.pyandtests/test_security.py. - Verified
raw_noteis checked withCONTROL_CHAR_REbefore.strip(), so leading tabs/newlines and trailing C1 controls are rejected instead of normalized into clean verifier metadata. - Verified ordinary whitespace-only notes still omit the note after trimming, and clean padded notes still trim before the existing 240-character cap.
- Verified the regression parametrizes newline, leading tab, and trailing
\x85cases through the admin payout API. - Checked hosted metadata: PR is open, non-draft, mergeable/clean, and the quality/readiness check plus CodeRabbit status are green.
Local validation on Windows:
.\.venv\Scripts\python.exe -m pytest tests\test_security.py -q-> 57 passed, 1 Starlette/httpx deprecation warning..\.venv\Scripts\python.exe -m ruff check app\bounty_api.py tests\test_security.py-> passed..\.venv\Scripts\python.exe -m ruff format --check app\bounty_api.py tests\test_security.py-> 2 files already formatted..\.venv\Scripts\python.exe -m mypy app\bounty_api.py-> success.git diff --check origin/main...HEAD-> clean.git merge-tree --write-tree origin/main HEAD-> clean merge tree19287c0b64811b4d58a5852f72b615bce00d9b70.
Verdict: APPROVED ? focused input-hardening fix for payout notes with regression coverage and no merge/test hygiene blockers found. No private data, credentials, wallet material, production mutation, signing, transfers, price/liquidity/exchange/bridge/off-ramp claims, or fabricated payout claims used.
Refs #576
Summary
Reject raw control characters in admin payout
notevalues before trimming them into public verifier metadata.This keeps values such as these from being accepted as clean notes during bounty payout proposal creation:
note="<tab>verified manually"note="verified manually\x85"Blank whitespace-only notes are still omitted, and ordinary space-padded notes are still trimmed before being stored.
Distinctness
This is limited to the admin payout API
notefield before it becomes verifier/proposal metadata. It does not overlap the existing #576 slices for attemptsource_url, MRWK amount strings, treasury proposal fields, webhook identities, wallet material, account/wallet/bounty filters, MCP arguments, JSON integers, forwarded proto headers, or deploy settings.Validation
tests/test_security.py: 57 passed, 1 warningmypy app/bounty_api.py: successgit diff --check: cleanorigin/main, PR Refs #576: Reject control chars in treasury proposals #621, and PR Refs #576: Reject C1 controls in deploy settings #623Safety
No private data, secrets, admin token values, wallet material, production mutation, price/liquidity/exchange/bridge/off-ramp claims, or fabricated payout claims are included.
Summary by CodeRabbit