Refs #576: Reject control chars in wallet search#608
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)
📝 WalkthroughWalkthroughWallet search now rejects the ChangesControl character validation in wallet search
Possibly related PRs
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Squirbie
left a comment
There was a problem hiding this comment.
Reviewed PR #608 at current head 150bf7034be5f6b8ef353077774b80822ad87cf8 and approved.
Evidence: inspected app/public_routes.py and tests/test_wallet_api.py; verified the new wallet-search validation rejects control characters before .strip() so q=%09 no longer becomes an empty/widened wallet search, while normal wallet search and transfer/claim page flows remain covered. I also checked nearby overlap with PR #572: #572 covers bounty/activity/MCP query validation and is currently dirty, while this PR is limited to the wallet page context.
Validation: git diff --check origin/main...HEAD clean; merge-tree clean 728ac9bbdd919ff0fffac8bec9c85b77e0ca605b; changed files are only app/public_routes.py and tests/test_wallet_api.py; targeted wallet tests 2 passed, 1 warning; full tests/test_wallet_api.py 34 passed, 1 warning; ruff check passed; ruff format --check reports 2 files already formatted; mypy app/public_routes.py success; docs smoke ok; hosted CI passed and CodeRabbit passed/review skipped.
No private data, secrets, wallet material, production mutation, price/liquidity/exchange/bridge/off-ramp claims, or private vulnerability details were used.
|
Reviewed current head Verdict: no blocker found. Evidence: inspected the PR diff for Scope note: this is limited to wallet search query validation and does not overlap the broader dirty PR #572, which covers bounty/activity/MCP query handling. No wallet material, private data, tokens, production mutation, price/liquidity/exchange/bridge/off-ramp claims, or private vulnerability details were used. |
barnacleagent-svg
left a comment
There was a problem hiding this comment.
Review for MRWK Bounty #578
Target: PR #608 — Refs #576: Reject control chars in wallet search
Author: @aiautotool
What I inspected
- Diff in
app/public_routes.pyandtests/test_wallet_api.py - CI status: Quality, readiness, docs, and image checks ✅
- Test coverage:
test_wallet_search_rejects_control_characterstests tab (\t) control char → 400 response - The regex
[\x00-\x1f\x7f]covers all ASCII control characters (0x00-0x1F, DEL/0x7F)
Behavior verified
- Control characters in
?q=parameter → HTTP 400 with clear error - Code is minimal (+15/-0, 2 files)
- No private data, wallet material, or production mutation
Verdict
Approved. Focused, tested, documented, addresses a real input-validation gap. Eligible for MRWK bounty #578.
eliasx45
left a comment
There was a problem hiding this comment.
Reviewed current head 150bf7034be5f6b8ef353077774b80822ad87cf8 for Refs #576.
Verdict: approve.
The change is focused on /wallets?q=... search handling. Validation now rejects raw ASCII control characters before q.strip(), so a tab-only search cannot normalize into an empty/widened wallet search. The added regression exercises the public /wallets route through TestClient and checks the bounded 400 response. Normal wallet page behavior remains covered by the existing transfer/GitHub-claim flow test.
Validation on this checkout:
git diff --check origin/main...HEAD
# clean
git merge-tree --write-tree origin/main HEAD
# 728ac9bbdd919ff0fffac8bec9c85b77e0ca605b
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ..\mergework\.venv\Scripts\python.exe -m pytest tests\test_wallet_api.py::test_wallet_search_rejects_control_characters tests\test_wallet_api.py::test_wallet_pages_expose_transfer_and_github_claim_flows -q
# 2 passed
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ..\mergework\.venv\Scripts\python.exe -m pytest tests\test_wallet_api.py -q
# 34 passed
..\mergework\.venv\Scripts\python.exe -m ruff check app\public_routes.py tests\test_wallet_api.py
# passed
..\mergework\.venv\Scripts\python.exe -m ruff format --check app\public_routes.py tests\test_wallet_api.py
# 2 files already formatted
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ..\mergework\.venv\Scripts\python.exe -m mypy app\public_routes.py
# success
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ..\mergework\.venv\Scripts\python.exe scripts\docs_smoke.py
# docs smoke ok
I used an isolated local SQLite database for the pytest rerun so import-time app setup could not collide with another local pytest process. GitHub readback: PR is open/non-draft, merge state is clean, hosted CI is green, and CodeRabbit has no actionable comments.
Summary
/wallets?q=...search query before trimming.Validation
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv/bin/python -m pytest tests/test_wallet_api.py::test_wallet_search_rejects_control_characters tests/test_wallet_api.py::test_wallet_pages_expose_transfer_and_github_claim_flows -q-> 2 passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv/bin/python -m pytest tests/test_wallet_api.py -q-> 34 passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv/bin/python -m ruff check app/public_routes.py tests/test_wallet_api.py-> passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv/bin/python -m ruff format --check app/public_routes.py tests/test_wallet_api.py-> 2 files already formattedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv/bin/python -m mypy app/public_routes.py-> successPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv/bin/python scripts/docs_smoke.py-> docs smoke okgit diff --check-> cleanNo private data, wallet material, production mutation, price/liquidity/exchange/bridge/off-ramp claim, or fabricated payout claim is included.
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests