Summary
The erxes insurance_api plugin does not require authentication for GraphQL mutations that manage contract templates. An unauthenticated attacker may alter templates and, if they are rendered by generateContractPDF, use injected HTML to access internal network content and expose customer fields in generated PDFs.
Affected context
The vulnerability affects erxes deployments with the insurance_api plugin where the relevant GraphQL mutations are accessible without authentication. Risk is greater when modified templates are rendered by generateContractPDF using headless Chromium, because injected HTML may cause the renderer to retrieve internal network content.
Exploit preconditions
- Attack surface: GraphQL mutations in the insurance_api plugin
- Required access: No authentication, if the affected mutations are reachable by an unauthenticated client
- Trigger point: Template management mutations; exposure risk arises when an altered template is rendered by generateContractPDF
- Why exploitation is possible: The mutations lack an effective authentication requirement, and rendered HTML may cause the PDF-generation process to retrieve internal resources or include customer fields
Why this happens
The underlying issue is a missing authentication check on operations that create, overwrite, or delete contract templates. This maps to CWE-306: Missing Authentication for Critical Function: sensitive functionality is available without first verifying the caller's identity. Rendering attacker-controlled template content in a headless browser can further expose internal resources or data if the renderer has access to them.
Potential impact
- Unauthenticated users may create, overwrite, or delete contract templates.
- Injected HTML could cause the PDF renderer to request internal network resources.
- Generated PDFs may expose customer fields or retrieved internal content.
- Altered templates could undermine the integrity of contract documents.
General mitigation guidance
Defensive patterns include requiring authentication and appropriate authorization for all template-management operations, using deny-by-default access controls, and limiting template changes to trusted roles. Treat template content as untrusted: apply context-appropriate sanitization or use constrained templates that do not permit arbitrary HTML. Restrict the PDF renderer's network access and filesystem permissions, minimize the customer data available to it, and review which fields may be included in generated documents.
How teams detect issues like this
- Review GraphQL schemas and resolvers for template-management mutations that lack authentication or authorization checks.
- Use static analysis and code review to identify sensitive operations reachable before identity and permission checks.
- Monitor template creation, replacement, and deletion, especially unexpected changes or changes by unusual actors.
- Apply API policies that deny unauthenticated access to sensitive mutations, and test those policies in security checks.
- Review PDF-generation workflows for untrusted HTML and unnecessary network or data access; automated code review tools may help surface risky patterns.

