CoCalc CVE-2025-61514
MEDIUMAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate as low-privilege CoCalc user
-
DeliveryUpload crafted SVG to shared project
-
ExploitVictim opens file in HTML/file viewer
-
ExecutionSVG served inline executes embedded JavaScript
-
ImpactScript runs in victim's CoCalc origin/session
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Command injection prevention
MITRE ATT&CK
1 technique across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires (1) an authenticated CoCalc account able to upload a file into a project reachable by the victim, and (2) a victim who opens/views the crafted file in CoCalc's HTML/file viewer. The root condition is that, before commit 0d2ff58, files with content-type image/svg+xml or text/html were served inline (not forced to download) via the hub proxy and rendered in an iframe without a restrictive sandbox, allowing embedded JavaScript to run in the CoCalc web origin. Limiting factors: victim interaction is required to open the file; shared-project access is needed; and the impact is confined to the CoCalc browser origin/session (stored XSS), not OS-level remote code execution as the RCE/Command-Injection tags imply. |
| Impact | Signals point to a medium, not top-tier, priority. The input CVSS is 6.5 (AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N), EPSS is low at 0.41% (35th percentile), there is no CISA KEV listing, and the vuln.today decision label is 'this_month' - a moderate-urgency bucket, not act_now/emergency. These signals are consistent with each other: low probability, no confirmed active exploitation, moderate severity. The most important qualification is a conflict between the labels and the code evidence: the Tags (RCE, Command Injection, File Upload) and CWE-77 imply OS command execution, but the fix commit (0d2ff58) adds image/svg+xml and text/html to a DANGEROUS_CONTENT_TYPE set that forces a download/attachment disposition, and switches the HTML iframe to srcDoc with sandbox="allow-forms allow-scripts allow-presentation". That is the signature of stored cross-site-scripting via active content rendered inline in the CoCalc web origin, not OS-level command injection - so the real-world impact (browser-side script execution within a victim's session) is narrower than the RCE/Command-Injection framing suggests. The input CVSS also uses PR:N/UI:N, but uploading a file to a CoCalc project realistically requires an authenticated account, and a victim must open the crafted file for the payload to fire; verify the authentication/interaction assumptions, as the raw vector appears to overstate the unauthenticated, no-interaction nature of the issue. |
| Exploit ScenarioDerived | An authenticated CoCalc user uploads a crafted SVG (or HTML) file to a project shared with a victim. Before the fix, the proxy served such files inline with content-type image/svg+xml and rendered HTML in an un-sandboxed iframe, so when the victim opens the file in CoCalc's viewer the embedded JavaScript executes in the CoCalc web origin under the victim's session. A public PoC reference exists (mbiesiad/vulnerability-research) but it is not verified as working exploit code. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 05, 2026
Stored cross-site scripting in CoCalc (SageMath, Inc.) before commit 0d2ff58 lets an authenticated user who can place a file in a project reachable by the victim upload a crafted SVG or HTML file that runs JavaScript in the CoCalc web origin when the victim opens it in the built-in file/HTML viewer. Exploitation requires a valid CoCalc account, access to a shared project, and victim interaction (opening the crafted file); impact is confined to the CoCalc browser origin and session rather than OS-level code execution, contrary to the RCE and command-injection tags attached to this record. There is no CISA KEV entry and no confirmed active exploitation; EPSS is 0.41% (35th percentile), a public vulnerability-research reference exists but is not verified as working exploit code, and the vuln.today decision label is 'this_month'.
RemediationAI
Upstream fix available (PR/commit); released patched version not independently confirmed - update CoCalc to a build that includes commit 0d2ff5890a3ae62e941aad8a5884dd765b7e98fc, which is the complete remediation because it forces download of image/svg+xml and text/html files in the hub proxy, adds a sandbox attribute to the HTML iframe, and renders HTML via srcDoc instead of a raw file URL. Where an immediate upgrade is not possible, the closest compensating control is a reverse-proxy rule that overrides responses for project raw-file paths with Content-Disposition: attachment when the content type is image/svg+xml or text/html; the trade-off is that legitimate HTML and SVG previews stop rendering inline for all users. Restricting project collaboration to trusted accounts reduces exposure but does not remove it, since any authenticated collaborator can upload the crafted file, and the vendor fix remains the only complete resolution.
Affected ProductsAI
CoCalc from SageMath, Inc. at any commit prior to 0d2ff5890a3ae62e941aad8a5884dd765b7e98fc, covering both the hosted cocalc.com service and self-hosted CoCalc deployments built from earlier source; the affected components are the hub proxy file-serving path and the frontend HTML/iframe editor. No version-number ranges or CPE identifiers were supplied in the available data, so the commit boundary is the only reliable demarcation. Vendor repository and fix links are https://github.com/sagemathinc/cocalc and https://github.com/sagemathinc/cocalc/commit/0d2ff5890a3ae62e941aad8a5884dd765b7e98fc; an independent research write-up is referenced at https://github.com/mbiesiad/vulnerability-research/tree/main/CVE-2025-61514.
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
CoCalc served project files through its hub proxy (src/packages/hub/proxy/handle-request.ts), setting the response Content-Type from mime.lookup(fileName) and streaming the file inline unless the request carried a download parameter. Because image/svg+xml and text/html were served inline, and because the HTML editor rendered content in an iframe (src/packages/frontend/frame-editors/html-editor/iframe-html.tsx) that had no restrictive sandbox attribute, attacker-supplied markup - SVG is scriptable when rendered as a document - executed JavaScript in the CoCalc origin, giving stored XSS against other users of the project. The root cause is unsafe handling of attacker-controlled file content types combined with unsandboxed rendering, not the command-injection class implied by CWE-77 or the RCE/Command Injection tags in the source data; the independent assessment reclassifies the issue as a scope-changed stored XSS (AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N). The upstream fix introduces a DANGEROUS_CONTENT_TYPE set containing image/svg+xml and text/html that forces those files to be downloaded rather than rendered, adds sandbox="allow-forms allow-scripts allow-presentation" to the iframe, switches HTML rendering to a srcDoc value, and adds a streaming readFile API on the project client (backed by the NATS files read package) so HTML content is read and injected locally instead of fetched from a raw URL.
Know when the next one hits your stack
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
Inline SVG/HTML executes as stored XSS in the victim's CoCalc origin: authenticated upload (PR:L), victim must open the file (UI:R), and script crosses into the browser context (S:C) with limited C/I and no availability impact.
Primary rating from Vendor (mitre).
CVSS VectorVendor: mitre
DescriptionCVE.org
An arbitrary file upload vulnerability in SageMath, Inc CoCalc before commit 0d2ff58 allows attackers to execute arbitrary code via uploading a crafted SVG file.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
Malicious file upload attacks exploit insufficient validation when web applications accept user-provided files.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
NVD
CVE.org
EPSS
GitHub
VulDB
Exploit-DB