Repository navigation
fix(security): backend security hardening - #36655
Conversation
Keep only the authorization code from the callback redirect and take the ID token from the token endpoint's answer for that code. Require the code whatever the response type is: the client redirects back in query mode, where providers return a code and never a token. Test Login follows the same rule.
…e events A stored user carries its authentication mechanism: a person's password hash, or a bot's token. Reads withhold it; keep it out of write responses and change events too. - Mark the authenticationMechanism definition in user.json as masked, so masked serialization of a user leaves it out. The marker sits on the definition because a "mask" beside a $ref never reaches the generator. - Serialize the change event recorded when users are seeded the masked way. - Return no mechanism for a person from create, PUT, PATCH, delete and restore. A bot's response is unchanged. - Remove the mechanism from stored user events (2.0.8 post-data migration, MySQL and PostgreSQL).
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
✅ SSO Login Nightly — PASSED View workflow run · Commit
Totals: 94 passed · 0 failed · 0 flaky · 0 skipped · duration 17m 12s |
Code Review ✅ Approved🔴 High risk · The OIDC callback rejects code-less sign-ins, and migrations remove credentials from historical events, potentially blocking implicit-flow logins and altering stored audit records. Hardens the OIDC confidential callback to take only the authorization code and refuse callbacks without one, and keeps user authentication mechanisms (password hashes) out of user write responses and change events, with a migration scrubbing stored events. No issues found. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
🚦 Removed from the merge queue —
|
* fix(security): validate the audience, issuer and tenant of identity-provider tokens Tokens not signed with OpenMetadata's own key must name a configured client (clientId or oidcConfiguration.id) in their audience, carry the issuer from the provider's discovery document when the server-side client knows it, and, for a public Entra ID client whose authority names a tenant ID, come from that tenant. The discovery document is read on demand, so the server still starts while the provider is unreachable. The IT harness presents the ID token, as browsers do. Backport of the provider-token validation in #34967 and the tenant check in #36156. The rest of #34967 does not apply: 2.0 still mints its own token for confidential sign-ins. * fix(security): take only the authorization code from the OIDC callback Establish the login session only from the ID token the token endpoint returns for the callback's authorization code. Require the code whatever the response type is (the client redirects back in query mode, where providers return a code and never a token) and keep nothing else from the redirect. Backport of #35679 and of its follow-up on main. Test Login, which the follow-up also changed, does not exist on 2.0. * fix(security): keep user credentials out of responses, snapshots and change events A stored user carries its authentication mechanism: a person's password hash, or a bot's token. Reads withhold it; keep it out of every other way a user leaves the server. - Versions and history return user snapshots without it. - Listing change events requires an admin or a bot. - The authenticationMechanism definition in user.json is masked, so masked serialization of a user leaves it out, and the event recorded when users are seeded is serialized that way. - Create, PUT, PATCH, delete and restore return no mechanism for a person. A bot's response is unchanged. - The 2.0.8 post-data migration removes it from stored user events (MySQL and PostgreSQL). Backport of the snapshot redaction in #36156, the change-event listing check in #34838, and #36655. * docs: state the rules in comments



Summary
Backend security hardening from an internal review, one commit per area:
Each commit carries its own regression tests. Details are tracked internally.
🤖 Generated with Claude Code