Ports upstream's "fix: jwt bypass" into our fork. All of Postiz's JWT
tokens (login, password reset, team invite, integration no-auth action,
enterprise billing portal) are signed with the same secret and were only
checked for the presence of certain fields, not their type or mutual
exclusivity - so a token minted for one purpose (e.g. a password-reset or
team-invite link, which a recipient's browser sends on every request)
could be replayed against a different endpoint (billing, integration
actions, enterprise webhooks) that happened to accept a payload shaped
similarly enough.
Tightens every one of those JWT consumers to:
- require the expected fields to be the correct type (string), not just
truthy
- reject payloads carrying fields unique to a different token kind
(`timeLimit` = team invite, `expires` = password reset)
- cross-check `provider`/`providerIdentifier` on the no-auth integration
action endpoint, closing a path where the wrong provider's integration
could be targeted
- select only `id` from Prisma integration updates instead of returning
the full row (defense in depth, matches the credential-model rule in
CLAUDE.md)
No functional change for any legitimate token flow; verified with
`tsc --noEmit` on apps/backend (zero new errors vs the pre-cherry-pick
baseline - the handful of reported errors are pre-existing, unrelated
`noImplicitAny` issues in agent/media/email files this change never
touches).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>