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.
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