Skip to content

Commit cfe4d4a

Browse files
1 parent 5b6e440 commit cfe4d4a

File tree

2 files changed

+154
-0
lines changed

2 files changed

+154
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-52c5-vh7f-26fx",
4+
"modified": "2025-11-06T15:44:36Z",
5+
"published": "2025-11-06T15:44:35Z",
6+
"aliases": [],
7+
"summary": "Cross-Site Scripting (XSS) vulnerability through unescaped HTML attribute values",
8+
"details": "### Impact\n\nThe prosemirror_to_html gem is vulnerable to Cross-Site Scripting (XSS) attacks through malicious HTML attribute values. While tag content is properly escaped, attribute values are not, allowing attackers to inject arbitrary JavaScript code.\n\n**Who is impacted:**\n- Any application using prosemirror_to_html to convert ProseMirror documents to HTML\n- Applications that process user-generated ProseMirror content are at highest risk\n- End users viewing the rendered HTML output could have malicious JavaScript executed in their browsers\n\n**Attack vectors include:**\n- `href` attributes with `javascript:` protocol: `<a href=\"javascript:alert(document.cookie)\">`\n- Event handlers: `<div onclick=\"maliciousCode()\">`\n- `onerror` attributes on images: `<img src=x onerror=\"alert('XSS')\">`\n- Other HTML attributes that can execute JavaScript\n\n### Patches\n\nA fix is currently in development. Users should upgrade to version **0.2.1** or later once released.\n\nThe patch escapes all HTML attribute values using `CGI.escapeHTML` to prevent injection attacks.\n\n### Workarounds\n\nUntil a patched version is available, users can implement one or more of these mitigations:\n\n1. **Sanitize output**: Pass the HTML output through a sanitization library like [Sanitize](https://github.com/rgrove/sanitize) or [Loofah](https://github.com/flavorjones/loofah):\n```ruby\n html = ProsemirrorToHtml.render(document)\n safe_html = Sanitize.fragment(html, Sanitize::Config::RELAXED)\n```\n\n2. **Implement Content Security Policy (CSP)**: Add strict CSP headers to prevent inline JavaScript execution:\n```\n Content-Security-Policy: default-src 'self'; script-src 'self'\n```\n\n3. **Input validation**: If possible, validate and sanitize ProseMirror documents before conversion to prevent malicious content from entering the system.\n\n### References\n\n- Vulnerable code: https://github.com/etaminstudio/prosemirror_to_html/blob/ea8beb32f6c37f29f042ba4155ccf18504da716e/lib/prosemirror_to_html.rb#L249\n- [OWASP XSS Prevention Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html)\n- [CWE-79: Improper Neutralization of Input During Web Page Generation](https://cwe.mitre.org/data/definitions/79.html)",
9+
"severity": [
10+
{
11+
"type": "CVSS_V3",
12+
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N"
13+
}
14+
],
15+
"affected": [
16+
{
17+
"package": {
18+
"ecosystem": "RubyGems",
19+
"name": "prosemirror_to_html"
20+
},
21+
"ranges": [
22+
{
23+
"type": "ECOSYSTEM",
24+
"events": [
25+
{
26+
"introduced": "0"
27+
},
28+
{
29+
"fixed": "0.2.1"
30+
}
31+
]
32+
}
33+
]
34+
}
35+
],
36+
"references": [
37+
{
38+
"type": "WEB",
39+
"url": "https://github.com/etaminstudio/prosemirror_to_html/security/advisories/GHSA-52c5-vh7f-26fx"
40+
},
41+
{
42+
"type": "WEB",
43+
"url": "https://github.com/etaminstudio/prosemirror_to_html/commit/4d59f94f550bcabeec30d298791bbdd883298ad8"
44+
},
45+
{
46+
"type": "PACKAGE",
47+
"url": "https://github.com/etaminstudio/prosemirror_to_html"
48+
}
49+
],
50+
"database_specific": {
51+
"cwe_ids": [
52+
"CWE-79"
53+
],
54+
"severity": "HIGH",
55+
"github_reviewed": true,
56+
"github_reviewed_at": "2025-11-06T15:44:35Z",
57+
"nvd_published_at": null
58+
}
59+
}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-w2jf-268q-mrvh",
4+
"modified": "2025-11-06T15:44:04Z",
5+
"published": "2025-11-06T15:44:04Z",
6+
"aliases": [],
7+
"summary": "OpenTofu affected denials of service in \"tofu init\" with maliciously-crafted module package responses",
8+
"details": "### Impact\n\nUnauthenticated denial of service.\n\n### Summary\n\nWhen installing module packages from attacker-controlled sources, `tofu init` may use unbounded memory, cause high CPU usage, or crash when encountering maliciously-crafted TLS certificate chains or tar archives.\n\nThose who depend on modules or providers served from untrusted third-party servers may experience denial of service due to `tofu init` failing to complete successfully. In the case of unbounded memory usage or high CPU usage, other processes running on the same computer as OpenTofu may also fail or have their performance degraded due to the depletion of shared system resources.\n\nThese vulnerabilities **do not** permit arbitrary code execution or allow disclosure of confidential information.\n\n### Details\n\nOpenTofu relies on third-party implementations of TLS certificate verification and tar archive extraction from the standard library of the Go programming language.\n\nThe Go project has recently published the following advisories for those implementations which indirectly affect OpenTofu's behavior:\n\n- [CVE-2025-58183](https://www.cve.org/CVERecord?id=CVE-2025-58183): Unbounded allocation when parsing GNU sparse map in archive/tar\n- [CVE-2025-58185](https://www.cve.org/CVERecord?id=CVE-2025-58185): Parsing DER payload can cause memory exhaustion in encoding/asn1\n- [CVE-2025-58187](https://www.cve.org/CVERecord?id=CVE-2025-58187): Quadratic complexity when checking name constraints in crypto/x509\n- [CVE-2025-58188](https://www.cve.org/CVERecord?id=CVE-2025-58188): Panic when validating certificates with DSA public keys in crypto/x509\n\nOpenTofu's threat model considers module and package dependencies to be arbitrary third-party code that operators must carefully review after installation. However, these particular problems affect the process of _installing_ these dependencies with `tofu init`, and so can potentially occur before an operator has had the opportunity to review what is being installed. In particular, the TLS-related vulnerabilities can occur before OpenTofu actually retrieves a dependency package and performs checksum verification, because they affect the transport of the packages rather than the content of the packages.\n\nAn attacker can exploit this either by controlling the TLS certificate chain used to authenticate the connection to the server where the dependencies are hosted, or (in the case of module packages only) by controlling the content of a package served when OpenTofu is expecting to receive a package using the \"tar\" archive format with or without compression.\n\nHowever, the attacker must also coerce an OpenTofu operator into attempting dependency installation from the server they control. Typical use of OpenTofu already requires caution in selection of third-party dependencies because they are arbitrary code, and so the vulnerability here is only in the addition of a potential denial of service in the `tofu init` process, which does not execute third-party dependency code itself.\n\n### Patches\n\nOpenTofu v1.10.7 addresses these vulnerabilities by being built against Go 1.24.9, which contains improved versions of the upstream implementations.\n\nThe OpenTofu v1.9 and v1.8 series are also impacted by these vulnerabilities. However, those series are built with a version of Go for which no upstream fix is available. Adopting Go 1.24.9 for those series would effectively end support for certain versions of macOS and Linux, and the OpenTofu Project has determined that the impact of these vulnerabilities is not high enough to justify that disruption in a patch release. For those using the OpenTofu v1.9 or v1.8 releases we recommend planning to upgrade to OpenTofu v1.10.7 in the near future, and reviewing the Workarounds section below in the meantime.\n\n### Workarounds\n\nThese vulnerabilities can be exploited only if an attacker can coerce an operator to add a dependency from an attacker-controlled source to their configuration before running `tofu init`. Those who are unable to upgrade can therefore minimize risk by reviewing new dependencies _before_ adding them to the configuration, such as by directly fetching the relevant artifacts using software other than OpenTofu.\n\nSuccessful exploitation requires that the attacker control either an HTTPS server that `tofu init` would contact during dependency installation or a tar archive that OpenTofu would fetch and extract during the module installation process. Note that OpenTofu modules can have their own dependencies on other modules, so an attacker could potentially use a module served from a source such as GitHub or the OpenTofu Registry to indirectly request a module from a server they control.",
9+
"severity": [
10+
{
11+
"type": "CVSS_V3",
12+
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:L"
13+
}
14+
],
15+
"affected": [
16+
{
17+
"package": {
18+
"ecosystem": "Go",
19+
"name": "github.com/opentofu/opentofu"
20+
},
21+
"ranges": [
22+
{
23+
"type": "ECOSYSTEM",
24+
"events": [
25+
{
26+
"introduced": "0"
27+
},
28+
{
29+
"fixed": "1.10.7"
30+
}
31+
]
32+
}
33+
]
34+
}
35+
],
36+
"references": [
37+
{
38+
"type": "WEB",
39+
"url": "https://github.com/opentofu/opentofu/security/advisories/GHSA-w2jf-268q-mrvh"
40+
},
41+
{
42+
"type": "WEB",
43+
"url": "https://github.com/opentofu/opentofu/issues/3458"
44+
},
45+
{
46+
"type": "WEB",
47+
"url": "https://github.com/opentofu/opentofu/issues/3462"
48+
},
49+
{
50+
"type": "WEB",
51+
"url": "https://github.com/opentofu/opentofu/issues/3464"
52+
},
53+
{
54+
"type": "WEB",
55+
"url": "https://github.com/opentofu/opentofu/issues/3465"
56+
},
57+
{
58+
"type": "WEB",
59+
"url": "https://github.com/opentofu/opentofu/pull/3467"
60+
},
61+
{
62+
"type": "PACKAGE",
63+
"url": "https://github.com/opentofu/opentofu"
64+
},
65+
{
66+
"type": "WEB",
67+
"url": "https://github.com/opentofu/opentofu/releases/tag/v1.10.7"
68+
},
69+
{
70+
"type": "WEB",
71+
"url": "https://www.cve.org/CVERecord?id=CVE-2025-58183"
72+
},
73+
{
74+
"type": "WEB",
75+
"url": "https://www.cve.org/CVERecord?id=CVE-2025-58185"
76+
},
77+
{
78+
"type": "WEB",
79+
"url": "https://www.cve.org/CVERecord?id=CVE-2025-58187"
80+
},
81+
{
82+
"type": "WEB",
83+
"url": "https://www.cve.org/CVERecord?id=CVE-2025-58188"
84+
}
85+
],
86+
"database_specific": {
87+
"cwe_ids": [
88+
"CWE-1395"
89+
],
90+
"severity": "LOW",
91+
"github_reviewed": true,
92+
"github_reviewed_at": "2025-11-06T15:44:04Z",
93+
"nvd_published_at": null
94+
}
95+
}

0 commit comments

Comments
 (0)