Cloudanix VulnDB

CVE-2025-30223

Critical · 9.3

Beego 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

Monitor only SSVC: Track

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

  1. Identify an endpoint or template that accepts user data and passes it to RenderForm()
  2. Craft a payload that breaks out of the expected attribute or element context and injects executable JavaScript
  3. Submit the payload through the normal application workflow so it is stored or reflected
  4. Lure a victim user (or administrator) to view the generated form
  5. 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