Install
$ agentstack add skill-lonsdale201-wp-agent-skills-br-hmac-signature ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ● Environment & secrets Used
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
better-route: HMAC request signatures
Use this for server-to-server endpoints, webhooks, and back-channel calls where a bearer user token is not the right primitive. The middleware validates headers before the handler runs.
Pattern
use BetterRoute\Middleware\Auth\ArrayHmacSecretProvider;
use BetterRoute\Middleware\Auth\HmacSignatureMiddleware;
$hmac = new HmacSignatureMiddleware(
secrets: new ArrayHmacSecretProvider([
'primary' => getenv('MYAPP_WEBHOOK_SECRET'),
'next' => getenv('MYAPP_WEBHOOK_SECRET_NEXT'),
]),
signatureHeader: 'X-Signature',
timestampHeader: 'X-Timestamp',
keyIdHeader: 'X-Key-Id',
replayWindowSeconds: 300,
algorithm: 'sha256'
);
$router->post('/webhooks/provider', $handler)
->middleware([$hmac])
->publicRoute();
Canonical input
The signature input is:
timestamp + "\n" + method + "\n" + path + "\n" + sha256(body)
Default headers:
X-SignatureX-TimestampX-Key-Id
Accepted signature encodings:
- lowercase hex
- uppercase hex
- base64
- base64url
- the same values prefixed with
sha256=
Critical rules
- Unknown key ID fails closed.
- Missing signature/timestamp/key-id fails closed with
401. - Timestamp outside
replayWindowSecondsfails closed. - Signature comparison uses
Crypto::equals(). - Keep secrets outside code; use constants/env/options managed by the host application.
- HMAC authenticates the sender and request body. It does not make the route private at the WordPress permission layer; pair public webhook routes with
->publicRoute()deliberately.
Cross-references
- Use
br-network-securityif the same route also needs a CIDR allowlist. - Use
br-routesforpublicRoute()vsprotectedByMiddleware()intent. - Use
br-error-contractfor401 invalid_signatureandstale_signaturehandling.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: Lonsdale201
- Source: Lonsdale201/wp-agent-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.