Summary
Prime CMS contains an authentication bypass in the /prime/graphql endpoint that allows unauthenticated users to register accounts through the createUser mutation. Because the authentication guard is disabled and roles are assigned administrative abilities, a registered attacker may gain control over content, users, webhooks, and settings.
Affected context
The issue affects Prime CMS through version 0.4.0-beta.0 where the GraphQL endpoint exposes the createUser mutation. The risk arises when the authentication check is not enforced and account abilities are derived from a role that is hard-coded to admin.
Exploit preconditions
- Attack surface: The
/prime/graphqlendpoint must be reachable. - Required access: No prior authentication is required, according to the vulnerability description.
- Trigger point: Account registration through the
createUsermutation. - Why exploitation is possible: The
isAuthenticated()guard check is commented out, andcreateAbility()assigns administrative abilities to every role.
Why this happens
The authentication check on a user-creation path is disabled, allowing the operation to proceed without verifying the caller's identity. This maps to CWE-306: Missing Authentication for Critical Function. Hard-coding administrative abilities for every role compounds the issue by granting excessive privileges to accounts created through that path.
Potential impact
- An unauthenticated attacker could create an account and obtain administrative control.
- An attacker may alter content, user accounts, webhooks, or application settings.
- Unauthorized changes could disrupt CMS operations or undermine the integrity of its data.
General mitigation guidance
Mitigation generally focuses on consistently enforcing authentication and authorization at sensitive operations.
Common defensive patterns include:
- Require verified authentication for account creation and other privileged mutations.
- Apply authorization checks server-side for each operation, using the caller's actual identity and role.
- Use deny-by-default permissions and grant only the capabilities needed for each role.
- Avoid assigning administrative privileges based on hard-coded or client-controlled values.
- Limit exposure of administrative GraphQL operations and reduce privileges available to application processes.
How teams detect issues like this
- Review GraphQL resolvers and middleware for mutations that lack enforced authentication or authorization checks.
- Use static analysis and code review to identify commented-out guards, unconditional admin-role assignments, and overly broad permission mappings.
- Test unauthenticated requests against sensitive mutations as part of security testing.
- Enforce policy checks in CI to flag privileged operations without explicit authentication and authorization controls.

