Refs #576: Reject control chars in webhook identities#622
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)
📝 WalkthroughWalkthroughAdded control-character detection to GitHub webhook handling. The webhook identity fields (repository name, submitter login, sender login) are now validated to reject control characters before processing; if fields contain control characters or are missing, specific rejection statuses ( ChangesWebhook Identity Field Validation
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
yui-stingray
left a comment
There was a problem hiding this comment.
Reviewed current head c649dcecdacf18bf7b66a561e1cba63ff63915b3 and did not find a blocker.
I checked the focused webhook diff in app/webhooks/github.py and tests/test_webhooks.py. The new control-character regex covers C0, DEL, and C1 characters, and _clean_webhook_string() rejects those values before trimming. The accepted-label handler now rejects malformed repository identity data and missing/invalid submitter or sender identity before bounty lookup or payout handling. The regression covers repository, submitter, and sender identity inputs and confirms no balance is credited when those malformed deliveries are processed.
Validation performed:
git diff --check origin/main...origin/pr-622passedgit merge-tree --write-tree origin/main origin/pr-622succeededtests/test_webhooks.pypassed: 22 testspy_compileon touched files passed- Ruff check and format check on touched files passed
- docs smoke passed
CodeRabbit reported no actionable comments, and GitHub quality checks are green.
eliasx45
left a comment
There was a problem hiding this comment.
Reviewed current head c649dcecdacf18bf7b66a561e1cba63ff63915b3.
Verdict: approve from technical review.
The webhook identity hardening is focused on the accepted-label payout path. _clean_webhook_string() rejects raw C0, DEL, and C1 control characters before trimming, and the accepted-label handler now applies it to repository full name, submitter login, and sender login before bounty lookup or payout resolution. The regression covers malformed repository, submitter, and sender identity values, verifies the expected non-credit statuses, and confirms the claimant balance is not credited for malformed deliveries.
Validation on an updated origin/main:
git diff --check origin/main...HEAD
# clean
git merge-tree --write-tree origin/main HEAD
# 63aaa17c5f5f01cc7db9bbebe896eca90da35554
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest -q tests/test_webhooks.py --tb=short
# 22 passed
python -m py_compile app/webhooks/github.py tests/test_webhooks.py
# passed
python -m ruff check app/webhooks/github.py tests/test_webhooks.py
# passed
python -m ruff format --check app/webhooks/github.py tests/test_webhooks.py
# 2 files already formatted
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python scripts/docs_smoke.py
# docs smoke ok
Note: this is a code review only. I am not claiming this under #578 because the maintainer has already posted that the current review-bounty round is at capacity.
Summary
Validation
/claim #576
Summary by CodeRabbit
Bug Fixes
Tests