Summary
A missing signature verification check in Nextcloud's User OIDC feature allowed a compromised or malicious ID4me authority to assert any user identity.
When a Nextcloud instance trusted such an authority, it could accept forged tokens and log the attacker in as arbitrary users, including administrative accounts.
Affected context
This vulnerability affects Nextcloud deployments that:
- Use the User OIDC app and integrate with ID4me-compatible identity authorities, and
- Trust external authorities for authenticating users, and
- Rely on the ID4me authority's responses without an independent trust anchor check.
In this context, the Nextcloud server treated responses from the ID4me authority as authentic without enforcing full cryptographic signature verification, which weakened the trust boundary between the identity provider and the service.
Exploit preconditions
- Attack surface: The User OIDC / ID4me login endpoint exposed by the Nextcloud instance.
- Required access: Control over, or ability to operate, a malicious or compromised ID4me authority that the Nextcloud instance is configured to trust.
- Trigger point: An OIDC/ID4me login flow where the attacker's authority returns a crafted identity response for a chosen Nextcloud account.
- Why exploitation is possible: Because the response signature from the ID4me authority was not properly verified, Nextcloud could not distinguish between genuine and forged identity assertions, allowing an attacker-controlled authority to claim any user identity.
Why this happens
The core issue is an improper authentication implementation in the User OIDC ID4me integration.
Instead of enforcing strict cryptographic verification of identity assertions (for example, verifying digital signatures and issuer properties against a trusted configuration), the component accepted assertions from the ID4me authority without fully validating their authenticity.
This maps to CWE-287: Improper Authentication, where the authentication logic fails to rigorously prove that an entity is who it claims to be.
At an abstract level, the pattern is: an application consumes identity tokens or claims from an external provider but omits or misconfigures the essential verification step that binds those claims to a trusted key and issuer, thereby collapsing the trust boundary.
Potential impact
- Attacker-controlled ID4me authority may impersonate any Nextcloud user account.
- Complete account takeover for targeted users, including administrators.
- Unauthorized access to private files, calendars, contacts, and collaborative content.
- Escalation to full application compromise if administrative functions are abused.
- Potential data exfiltration, data tampering, or deletion of user content.
General mitigation guidance
Effective mitigation generally centers on hardening authentication flows and reinforcing identity trust boundaries:
- Enforce strict cryptographic validation of all external identity assertions, including signature checks, issuer validation, and audience restrictions.
- Use established OIDC libraries and configuration patterns that are secure by default and minimize custom verification logic.
- Limit which external identity providers are trusted and regularly review those trust relationships.
- Apply least privilege to administrative accounts and consider separating duties so that ID-based compromise yields minimal control.
- Introduce defense-in-depth checks, such as anomaly detection or step-up authentication for sensitive actions, to reduce the impact of mistaken trust in an identity provider.
How teams detect issues like this
Detection efforts can focus on both code-level issues and runtime behavior:
- Static analysis rules or manual code review that flag authentication flows where:
- Token or assertion signatures are not verified, or
- Verification results are ignored, or
- Trust in external authorities is configured without proper key validation.
- Configuration reviews to ensure identity provider metadata (issuer, JWKS endpoints, algorithms) are explicitly validated.
- Logging and monitoring of authentication events to detect:
- Unusual login patterns from the same ID4me authority across many accounts.
- Sudden access to high-privilege accounts from unfamiliar identity providers.
- Automated security testing or QA checks that attempt to supply tampered or unsigned identity assertions to verify that the service rejects them.

