CVE-2025-30223
Critical · 9.3Beego allows Reflected/Stored XSS in Beego's RenderForm() Function Due to Unescaped User Input
CVSS
9.3
EPSS
0.6%
Published
Mar 31, 2025
CISA due date
—
Cloudanix analysis
A form-building feature in the Beego framework does not safely handle data supplied by users, allowing an attacker to run harmful code inside other people's browsers when they view the form.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Privilege Gain
- Component
- Web Framework
- Class
- XSS
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The RenderForm() function fails to HTML-escape user-supplied values when emitting form markup, allowing injected script, event handlers, or attribute payloads to be rendered verbatim and executed in the victim's browser context.
Why it matters to the business
Applications built on Beego that surface user-controlled data through RenderForm expose end users to session theft, credential capture, or account takeover; the defect is widespread because the high-level helper is expected to sanitize output automatically.
How an attack unfolds
An attacker supplies a crafted payload containing script or attribute-breaking syntax to any input that later reaches RenderForm(); when a victim loads the resulting page the browser executes the injected code under the application's origin, enabling cookie exfiltration, form submission to attacker-controlled endpoints, or further client-side attacks.
How to fix it
Upgrade the beego/beego dependency to the commit 5fa33bc11b947d0ddd0f68eb0cb8903741900f00 or later; after upgrade, re-test all call sites of RenderForm() with known XSS vectors to confirm escaping is now enforced.
How to confirm the fix worked
Confirm the running binary or module version contains commit 5fa33bc11b947d0ddd0f68eb0cb8903741900f00; perform a regression test by submitting a benign XSS probe (e.g., <img src=x onerror=alert(1)>) through RenderForm() and verify the output is escaped.
Typical attack path
- Identify an endpoint or template that accepts user data and passes it to RenderForm()
- Craft a payload that breaks out of the expected attribute or element context and injects executable JavaScript
- Submit the payload through the normal application workflow so it is stored or reflected
- Lure a victim user (or administrator) to view the generated form
- Execute malicious actions in the victim's browser session such as stealing cookies or performing unauthorized operations
How to detect it
Search web-application or proxy logs for requests containing HTML tags, event-handler attributes, or javascript: URIs that later appear inside generated form markup; review audit trails of pages served by RenderForm() for unexpected script execution or unusual attribute values.
What your security team should do
- Immediately inventory all Beego-based services and flag those using RenderForm() with untrusted data
- Schedule upgrade to the fixed commit within the next change window
- Add automated SAST or template-scanning rules that detect direct use of RenderForm() on user input
- Review any stored form data that may already contain malicious payloads and sanitize or purge it
The record
A Cross-Site Scripting (XSS) vulnerability exists in Beego's `RenderForm()` function due to improper HTML escaping of user-controlled data. This vulnerability allows attackers to inject malicious JavaScript code that executes in victims' browsers, potentially leading to session hijacking, credential theft, or account takeover. The vulnerability affects any application using Beego's `RenderForm()` function with user-provided data. Since it is a high-level function generating an entire form markup, many developers would assume it automatically escapes attributes (the way most frameworks do).
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Go | github.com/beego/beego | 0 | No fix |
| Go | github.com/beego/beego/v2 | 0 | 2.3.6 |
| Chainguard | harbor-2.10 | 0 | 2.10.3-r14 |
| Chainguard | harbor-2.10-jobservice | 0 | 2.10.3-r14 |
| Chainguard | harbor-2.10-portal | 0 | 2.10.3-r14 |
| Chainguard | harbor-2.10-portal-nginx-config | 0 | 2.10.3-r14 |
| Chainguard | harbor-2.10-registryctl | 0 | 2.10.3-r14 |
| Chainguard | harbor-2.11 | 0 | 2.11.2-r7 |
| Chainguard | harbor-2.11-exporter | 0 | 2.11.2-r7 |
| Chainguard | harbor-2.11-jobservice | 0 | 2.11.2-r7 |
| Chainguard | harbor-2.11-photon-registry | 0 | 2.11.2-r7 |
| Chainguard | harbor-2.11-portal | 0 | 2.11.2-r7 |
| Chainguard | harbor-2.11-portal-nginx-config | 0 | 2.11.2-r7 |
| Chainguard | harbor-2.11-redis-compat | 0 | 2.11.2-r7 |
| Chainguard | harbor-2.11-registryctl | 0 | 2.11.2-r7 |
| Chainguard | harbor-2.12 | 0 | 2.12.2-r9 |
| Chainguard | harbor-2.12-exporter | 0 | 2.12.2-r9 |
| Chainguard | harbor-2.12-jobservice | 0 | 2.12.2-r9 |
| Chainguard | harbor-2.12-photon-registry | 0 | 2.12.2-r9 |
| Chainguard | harbor-2.12-portal | 0 | 2.12.2-r9 |
| Chainguard | harbor-2.12-portal-nginx-config | 0 | 2.12.2-r9 |
| Chainguard | harbor-2.12-redis-compat | 0 | 2.12.2-r9 |
| Chainguard | harbor-2.12-registryctl | 0 | 2.12.2-r9 |
| Chainguard | harbor-2.9 | 0 | 2.9.5-r15 |
| Chainguard | harbor-2.9-jobservice | 0 | 2.9.5-r15 |
| Chainguard | harbor-2.9-portal | 0 | 2.9.5-r15 |
| Chainguard | harbor-2.9-portal-nginx-config | 0 | 2.9.5-r15 |
| Chainguard | harbor-2.9-registryctl | 0 | 2.9.5-r15 |
| Chainguard | harbor-fips-2.10 | 0 | 2.10.3-r14 |
| Chainguard | harbor-fips-2.10-db | 0 | 2.10.3-r14 |
| Chainguard | harbor-fips-2.10-jobservice | 0 | 2.10.3-r14 |
| Chainguard | harbor-fips-2.10-portal | 0 | 2.10.3-r14 |
| Chainguard | harbor-fips-2.10-registryctl | 0 | 2.10.3-r14 |
| Chainguard | harbor-fips-2.11 | 0 | 2.11.2-r10 |
| Chainguard | harbor-fips-2.11-db | 0 | 2.11.2-r10 |
| Chainguard | harbor-fips-2.11-exporter | 0 | 2.11.2-r10 |
| Chainguard | harbor-fips-2.11-jobservice | 0 | 2.11.2-r10 |
| Chainguard | harbor-fips-2.11-photon-registry | 0 | 2.11.2-r10 |
| Chainguard | harbor-fips-2.11-portal | 0 | 2.11.2-r10 |
| Chainguard | harbor-fips-2.11-redis-compat | 0 | 2.11.2-r10 |
| Chainguard | harbor-fips-2.11-registryctl | 0 | 2.11.2-r10 |
| Chainguard | harbor-fips-2.12 | 0 | 2.12.2-r9 |
| Chainguard | harbor-fips-2.12-db | 0 | 2.12.2-r9 |
| Chainguard | harbor-fips-2.12-exporter | 0 | 2.12.2-r9 |
| Chainguard | harbor-fips-2.12-jobservice | 0 | 2.12.2-r9 |
| Chainguard | harbor-fips-2.12-photon-registry | 0 | 2.12.2-r9 |
| Chainguard | harbor-fips-2.12-portal | 0 | 2.12.2-r9 |
| Chainguard | harbor-fips-2.12-redis-compat | 0 | 2.12.2-r9 |
| Chainguard | harbor-fips-2.12-registryctl | 0 | 2.12.2-r9 |
| Chainguard | harbor-fips-2.9 | 0 | 2.9.5-r14 |
| Chainguard | harbor-fips-2.9-db | 0 | 2.9.5-r14 |
| Chainguard | harbor-fips-2.9-jobservice | 0 | 2.9.5-r14 |
| Chainguard | harbor-fips-2.9-portal | 0 | 2.9.5-r14 |
| Chainguard | harbor-fips-2.9-registryctl | 0 | 2.9.5-r14 |
| Wolfi | harbor-2.11 | 0 | 2.11.2-r7 |
| Wolfi | harbor-2.11-jobservice | 0 | 2.11.2-r7 |
| Wolfi | harbor-2.11-portal | 0 | 2.11.2-r7 |
| Wolfi | harbor-2.11-portal-nginx-config | 0 | 2.11.2-r7 |
| Wolfi | harbor-2.11-registryctl | 0 | 2.11.2-r7 |
| Wolfi | harbor-2.12 | 0 | 2.12.2-r9 |
| Wolfi | harbor-2.12-jobservice | 0 | 2.12.2-r9 |
| Wolfi | harbor-2.12-portal | 0 | 2.12.2-r9 |
| Wolfi | harbor-2.12-portal-nginx-config | 0 | 2.12.2-r9 |
| Wolfi | harbor-2.12-registryctl | 0 | 2.12.2-r9 |
| openSUSE:Tumbleweed | govulncheck-vulndb | 0 | 0.0.20250402T160203-1.1 |
Related vulnerabilities
- CVE-2024-55885 Beego has Collision Hazards of MD5 in Cache Key Filenames Also affects github.com/beego/beego
- CVE-2025-47909 Hosts listed in TrustedOrigins implicitly allow requests from the corresponding HTTP… Also affects harbor-2.10
- CVE-2025-55198 Helm May Panic Due To Incorrect YAML Content Also affects harbor-2.10
- CVE-2025-55199 Helm Charts with Specific JSON Schema Values Can Cause Memory Exhaustion Also affects harbor-2.10
- CVE-2025-53547 Helm vulnerable to Code Injection through malicious chart.yaml content Also affects harbor-2.10
- CVE-2025-24358 gorilla/csrf provides Cross Site Request Forgery (CSRF) prevention middleware for Go web… Also affects harbor-2.10
- CVE-2025-32386 Helm Allows A Specially Crafted Chart Archive To Cause Out Of Memory Termination Also affects harbor-2.10
- CVE-2025-32387 Helm Allows A Specially Crafted JSON Schema To Cause A Stack Overflow Also affects harbor-2.10