Summary
EspoCRM has a stored cross-site scripting vulnerability involving crafted SVG images uploaded by low-privileged users. If an administrator opens an uploaded SVG in a separate browser tab and clicks it while authenticated, it may submit requests to backend endpoints and perform actions available to that administrator.
Affected context
The issue affects EspoCRM deployments with the vulnerable SVG image upload behavior. Risk arises when a low-privileged user can upload a crafted SVG and an administrator later opens that image in a separate browser tab and interacts with it while signed in.
Exploit preconditions
- Attack surface: SVG image upload and subsequent viewing in a browser
- Required access: A low-privileged account able to upload crafted SVG files
- Trigger point: An administrator opens the uploaded SVG in a separate tab and clicks it
- Why exploitation is possible: The SVG can cause authenticated POST requests to backend endpoints, allowing actions within the administrator's permissions
Why this happens
SVG files can contain active content, and treating uploaded SVGs as inert images without adequately sanitizing or isolating them can allow script-driven behavior in a browser. This is a stored cross-site scripting issue mapped to CWE-79: Improper Neutralization of Input During Web Page Generation. The vulnerable content is stored and later interpreted in a context where it can act using an authenticated user's session.
Potential impact
- An attacker may cause authenticated backend requests when an administrator interacts with the uploaded SVG
- Administrator-permitted actions could be performed without the administrator intending them
- An attacker could potentially elevate their account's privileges if the relevant administrative action is available
- Other data or configuration changes within the administrator's permissions could occur
General mitigation guidance
Defensive patterns focus on preventing uploaded SVG content from executing in a trusted application context.
- Prefer rejecting SVG uploads or converting them to a safe raster format when vector functionality is not essential
- If SVG support is required, apply robust allowlist-based sanitization and serve files from an isolated origin or sandboxed context
- Use safe content-serving defaults, such as restrictive browser policies and download-oriented handling where appropriate
- Apply authorization checks and request-forgery protections to sensitive state-changing endpoints
- Keep user-uploaded content and application sessions separated, and limit user and service privileges
How teams detect issues like this
- Review upload and rendering code for SVG files served inline from the authenticated application origin
- Use static analysis and code review to identify unsafe HTML/SVG handling, incomplete sanitization, and untrusted content rendered in active browser contexts
- Test upload policies to confirm that disallowed SVG content is rejected, transformed, or isolated
- Monitor administrative audit logs for unexpected state-changing requests following user-uploaded content being viewed
- Enforce policies that restrict active content in user uploads and require security review of exceptions

