Summary
Coolify versions up to and including v4.0.0-beta.420.6 contain a stored XSS vulnerability in the project creation flow that allows JavaScript to be embedded in project names.
A low-privileged authenticated user can create a project with a malicious name that later executes in an administrator's browser when they attempt to delete the project or its associated resources.
Affected context
This vulnerability occurs in Coolify's web-based management interface during the lifecycle of projects, specifically when project names are created and later rendered in administrative views.
It becomes relevant in deployments where:
- Multiple users share a Coolify instance with different roles (e.g., member vs. admin),
- Project names entered by users are stored and later displayed in administrative pages,
- Output encoding or sanitization is insufficient at the points where project names are rendered, such as in delete or resource management dialogs.
Exploit preconditions
- Attack surface: Web UI of the Coolify management panel.
- Required access: Authenticated account with low-level permissions (e.g., a member role) that can create projects.
- Trigger point: An administrator or higher-privileged user visits a page that renders the malicious project name, such as when deleting the project or its associated resource.
- Why exploitation is possible: User-controlled project names are persisted and rendered back into the DOM without robust output encoding/escaping, allowing embedded script content to execute in the context of the admin's session.
Why this happens
The underlying issue is insufficient output encoding of stored user-controlled data (project names) when rendered in HTML/JavaScript contexts.
This maps to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting) and CWE-116: Improper Encoding or Escaping of Output.
Instead of treating project names strictly as inert text and consistently escaping them at every render point, the application allows raw or insufficiently escaped content to be injected into the page, so that embedded script constructs are interpreted by the browser.
Potential impact
- Execution of arbitrary JavaScript in an administrator's browser session.
- Theft of administrator cookies or session tokens, depending on security flags and browser protections.
- Unauthorized actions performed on behalf of the administrator (e.g., creating, modifying, or deleting infrastructure resources).
- Potential lateral movement to other systems managed via the Coolify interface.
- Manipulation of configuration or deployment settings leading to broader service disruption.
General mitigation guidance
Mitigation focuses on robust output handling and reducing the trust boundary around user-supplied fields:
- Apply context-aware output encoding for all user-controlled values, especially project names, wherever they are rendered (HTML body, attributes, JavaScript, or URLs).
- Treat all display-layer usage of stored data as untrusted and escape it using well-reviewed templating mechanisms or encoding helpers instead of manual concatenation.
- Introduce input validation rules for project names to reject or normalize characters commonly abused in XSS (such as angle brackets and event handler attributes), while balancing legitimate use cases.
- Apply Content Security Policy (CSP) with script restrictions (e.g., disallowing inline scripts and restricting script sources) to reduce impact if some injection vectors remain.
- Ensure privileged actions in the UI do not rely solely on client-side state and are protected with CSRF defenses and server-side authorization checks, limiting the damage of hijacked admin interactions.
- Adopt a secure-by-default UI framework or templating engine that auto-escapes variables, requiring explicit opt-out for raw HTML rendering.
How teams detect issues like this
Detection can combine code-centric and behavior-centric approaches:
- Use static analysis rules or linters to flag direct insertion of user-controlled fields (such as project names) into the DOM, HTML attributes, or JavaScript strings without encoding helpers.
- During code review, look for:
- Manual string concatenation in templates or JSX/Blade/Vue/React-like components that mix user data with HTML/JS.
- Any bypasses of auto-escaping mechanisms (e.g., rendering raw HTML) in views related to projects or resources.
- Define internal secure coding guidelines that require context-aware encoding and require reviewers to verify all display paths for stored user data.
- Employ dynamic application security testing (DAST) or automated browser-based scanners configured to inject XSS payload markers into form fields like project names and monitor for execution in subsequent views.
- Integrate SAST/DAST tools into CI/CD to catch regressions, with policies that block deployments when new unencoded sinks are detected.

