Skip to content

Harden Xero webhook signature validation#92

Open
MAJINSI wants to merge 1 commit into
BAWES-Universe:masterfrom
MAJINSI:harden-xero-webhook-signature-55
Open

Harden Xero webhook signature validation#92
MAJINSI wants to merge 1 commit into
BAWES-Universe:masterfrom
MAJINSI:harden-xero-webhook-signature-55

Conversation

@MAJINSI
Copy link
Copy Markdown

@MAJINSI MAJINSI commented May 15, 2026

Summary

  • move the Xero webhook signing key out of controller code and require XERO_WEBHOOK_SIGNING_KEY at runtime
  • validate the signature over request->rawBody, matching webhook HMAC expectations
  • compare signatures with hash_equals() and fail closed with framework 401 responses instead of echo/die output
  • add docs and a static regression guard for this webhook path

/claim #55

Verification

  • tests/check-xero-webhook-signature-hardening.sh
  • git diff --check
  • php -l admin/modules/v1/controllers/XeroWebhookController.php could not be run locally because this environment does not have php installed

Scope

This is a narrow Xero webhook signing-key validation slice. It does not touch Xero OAuth client-secret config already covered by other PRs, AWS/IAM/S3, Civil ID flows, OneSignal, service tokens, live Xero access, or real private signing-key values.

Transparency: AI-assisted with OpenAI Codex; I reviewed the diff and verification before submitting.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Warning

Rate limit exceeded

@MAJINSI has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 60 minutes before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e7b4326e-6387-4954-9be3-855892ed85b5

📥 Commits

Reviewing files that changed from the base of the PR and between 7b023ff and 2d3e306.

📒 Files selected for processing (3)
  • admin/modules/v1/controllers/XeroWebhookController.php
  • docs/xero-webhook-signing-key.md
  • tests/check-xero-webhook-signature-hardening.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@MAJINSI
Copy link
Copy Markdown
Author

MAJINSI commented May 16, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 16, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@MAJINSI
Copy link
Copy Markdown
Author

MAJINSI commented May 16, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 16, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant