Repository navigation
fix(jobs): reject empty and default _APP_JOBS_SECRET - #14116
Conversation
Treat _APP_JOBS_SECRET as unconfigured when it is missing, empty, or the public your-secret-key placeholder so /v1/jobs/event cannot be forged with the known default. New installs generate a unique token instead. Co-authored-by: Jake Barnby <[email protected]>
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
The fail-closed /v1/jobs/event check rejects the public your-secret-key placeholder, which hung CI function and site deployment waits. Point the dev/CI env at a unique secret so jobs callbacks still verify. Co-authored-by: Jake Barnby <[email protected]>
Security rulesNo new WARNING or ERROR findings from security rules. 19 existing findings tracked in
|
adhocore/jwt registers keys with array_merge, which renumbers integer-like string keys. A token signed under a kid such as "1234567890123456" resolved through the JWKS, then failed in the JWT layer with "Unknown key ID". The mock provider derives its kid from the first 16 hex chars of a SHA-1, so roughly one CI run in two thousand drew an all-digit kid and every ID token session test in that job failed with a 401. Real providers with numeric kids were rejected the same way. Register keys with an array union so key IDs keep their exact value. Co-Authored-By: Claude Opus 5.5 <[email protected]>
_APP_JOBS_SECRET_APP_JOBS_SECRET
Co-authored-by: Jake Barnby <[email protected]>
|
Review complete. 🟠 1 high 💬 Inline comments (1)
This PR introduces a dedicated
The committed secret lets stock clones sign valid job callbacks, so it should be reverted to the empty default before merge. Reviewed commit: e2ff41d |
|
@hansi-codes review |
🟢 Tier S · Ready to merge
This change rejects empty and placeholder jobs callback secrets, generates unique values in installer and Compose setup, and adds a doctor check. It also adds regression coverage and fixes OIDC verification for integer-like key IDs.
📂 Walkthrough · 11
Reviewed |
There was a problem hiding this comment.
Adds JobsSecret HMAC verification for the /v1/jobs/event endpoint plus OIDC/JWT verification hardening, new env wiring, Doctor checks, and unit tests - but commits a real signing secret in .env.
Key findings
- 🟠 Real
_APP_JOBS_SECRETcommitted in.env— .env:147
Co-authored-by: Jake Barnby <[email protected]>
|
@hansi-codes review |
The findings that requested changes are resolved. See the summary comment for what is still open.
commit: |
Co-authored-by: Jake Barnby <[email protected]>
|
@hansi-codes review |
The findings that requested changes are resolved. See the summary comment for what is still open.
Co-authored-by: Jake Barnby <[email protected]>
|
@hansi-codes review |
Co-authored-by: Jake Barnby <[email protected]>
|
@hansi-codes review |
…fault-03b4 fix(jobs): reject empty and default `_APP_JOBS_SECRET` (cherry picked from commit 7479c43)
What does this PR do?
JobsSecrettreats missing, empty, andyour-secret-keyas unconfigured and does not verify an HMAC against them./v1/jobs/eventuses that check, so a placeholder-keyed signature is rejected the same way as an invalid one._APP_JOBS_SECRET(filter: token) instead of writing the placeholder.envuses a unique local/CI secret so function and site deployment callbacks still verify (the public placeholder is no longer the committed default)appwrite doctorflags a default jobs secret the same way it flags the encryption keyA non-placeholder value still verifies normally.
Test Plan
tests/unit/Auth/JobsSecretTest.phpnull, empty, andyour-secret-keyeven when the HMAC digest matches that value--teston the touched PHP files.envstill used the rejected placeholder. Follow-up commit points.envat a unique secret.Related PRs and Issues
Checklist