CVE-2022-34297: n/a in n/a
Yii Yii2 Gii through 2.2.4 allows stored XSS by injecting a payload into any field.
AI Analysis
Technical Summary
CVE-2022-34297 is a stored Cross-Site Scripting (XSS) vulnerability affecting the Yii2 Gii code generation tool up to version 2.2.4. Yii2 is a popular PHP framework widely used for developing web applications, and Gii is its integrated code generator module that facilitates rapid development by generating models, controllers, forms, and more. This vulnerability allows an attacker with at least limited privileges (PR:L - privileges required: low) to inject malicious JavaScript payloads into any input field within the Gii interface. Because the vulnerability is stored XSS, the injected payload is saved on the server and subsequently executed in the browsers of users who access the affected pages. The CVSS 3.1 base score is 5.4 (medium severity), with an attack vector of network (AV:N), low attack complexity (AC:L), privileges required (PR:L), no user interaction (UI:N), unchanged scope (S:U), and impacts on confidentiality and integrity (C:L/I:L) but no impact on availability (A:N). The vulnerability stems from improper sanitization or encoding of user-supplied input in Gii fields, classified under CWE-79 (Improper Neutralization of Input During Web Page Generation). No public exploits or patches are currently documented, but the risk remains due to the potential for persistent script injection that can lead to session hijacking, defacement, or further exploitation of the affected web application environment. Given Gii is typically used in development or staging environments, exposure in production systems may vary, but misconfigurations or leftover Gii modules in production could be exploited.
Potential Impact
For European organizations using Yii2 framework with the Gii module enabled, this vulnerability poses a moderate risk. Stored XSS can lead to theft of user credentials, session tokens, or execution of arbitrary scripts in the context of the victim’s browser, potentially compromising sensitive data and user accounts. In sectors such as finance, healthcare, and government, where web applications handle sensitive personal or financial data, exploitation could lead to data breaches and regulatory non-compliance under GDPR. The integrity of web applications could be undermined, leading to loss of trust and reputational damage. Although availability is not directly impacted, the indirect consequences of compromised user sessions or injected malicious content could disrupt business operations. Since Gii is often disabled in production, the risk is higher if organizations fail to remove or secure this module post-development. European organizations with web applications developed on Yii2 that expose Gii interfaces publicly or internally without adequate access controls are particularly vulnerable.
Mitigation Recommendations
1. Immediately disable or remove the Gii module in all production environments to eliminate exposure. 2. If Gii must be used in production or accessible environments, restrict access strictly via IP whitelisting, VPNs, or strong authentication mechanisms to trusted developers only. 3. Apply input validation and output encoding on all user-supplied data fields within Gii to neutralize malicious scripts. 4. Monitor web application logs for suspicious input patterns indicative of XSS attempts. 5. Conduct regular security audits and penetration tests focusing on development tools and modules like Gii. 6. Keep Yii2 framework and its components updated to the latest versions where this vulnerability is patched. 7. Educate developers and system administrators about the risks of leaving development tools enabled in production. 8. Implement Content Security Policy (CSP) headers to mitigate the impact of potential XSS payloads by restricting script execution sources. 9. Use Web Application Firewalls (WAFs) configured to detect and block XSS attack patterns targeting known vulnerable endpoints.
Affected Countries
Germany, France, United Kingdom, Netherlands, Italy, Spain, Poland, Sweden, Belgium, Austria
CVE-2022-34297: n/a in n/a
Description
Yii Yii2 Gii through 2.2.4 allows stored XSS by injecting a payload into any field.
AI-Powered Analysis
Technical Analysis
CVE-2022-34297 is a stored Cross-Site Scripting (XSS) vulnerability affecting the Yii2 Gii code generation tool up to version 2.2.4. Yii2 is a popular PHP framework widely used for developing web applications, and Gii is its integrated code generator module that facilitates rapid development by generating models, controllers, forms, and more. This vulnerability allows an attacker with at least limited privileges (PR:L - privileges required: low) to inject malicious JavaScript payloads into any input field within the Gii interface. Because the vulnerability is stored XSS, the injected payload is saved on the server and subsequently executed in the browsers of users who access the affected pages. The CVSS 3.1 base score is 5.4 (medium severity), with an attack vector of network (AV:N), low attack complexity (AC:L), privileges required (PR:L), no user interaction (UI:N), unchanged scope (S:U), and impacts on confidentiality and integrity (C:L/I:L) but no impact on availability (A:N). The vulnerability stems from improper sanitization or encoding of user-supplied input in Gii fields, classified under CWE-79 (Improper Neutralization of Input During Web Page Generation). No public exploits or patches are currently documented, but the risk remains due to the potential for persistent script injection that can lead to session hijacking, defacement, or further exploitation of the affected web application environment. Given Gii is typically used in development or staging environments, exposure in production systems may vary, but misconfigurations or leftover Gii modules in production could be exploited.
Potential Impact
For European organizations using Yii2 framework with the Gii module enabled, this vulnerability poses a moderate risk. Stored XSS can lead to theft of user credentials, session tokens, or execution of arbitrary scripts in the context of the victim’s browser, potentially compromising sensitive data and user accounts. In sectors such as finance, healthcare, and government, where web applications handle sensitive personal or financial data, exploitation could lead to data breaches and regulatory non-compliance under GDPR. The integrity of web applications could be undermined, leading to loss of trust and reputational damage. Although availability is not directly impacted, the indirect consequences of compromised user sessions or injected malicious content could disrupt business operations. Since Gii is often disabled in production, the risk is higher if organizations fail to remove or secure this module post-development. European organizations with web applications developed on Yii2 that expose Gii interfaces publicly or internally without adequate access controls are particularly vulnerable.
Mitigation Recommendations
1. Immediately disable or remove the Gii module in all production environments to eliminate exposure. 2. If Gii must be used in production or accessible environments, restrict access strictly via IP whitelisting, VPNs, or strong authentication mechanisms to trusted developers only. 3. Apply input validation and output encoding on all user-supplied data fields within Gii to neutralize malicious scripts. 4. Monitor web application logs for suspicious input patterns indicative of XSS attempts. 5. Conduct regular security audits and penetration tests focusing on development tools and modules like Gii. 6. Keep Yii2 framework and its components updated to the latest versions where this vulnerability is patched. 7. Educate developers and system administrators about the risks of leaving development tools enabled in production. 8. Implement Content Security Policy (CSP) headers to mitigate the impact of potential XSS payloads by restricting script execution sources. 9. Use Web Application Firewalls (WAFs) configured to detect and block XSS attack patterns targeting known vulnerable endpoints.
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- mitre
- Date Reserved
- 2022-06-22T00:00:00.000Z
- Cisa Enriched
- true
Threat ID: 682d9848c4522896dcbf5e0c
Added to database: 5/21/2025, 9:09:28 AM
Last enriched: 6/22/2025, 6:05:22 AM
Last updated: 8/1/2025, 6:32:11 PM
Views: 12
Related Threats
CVE-2025-2713: CWE-269 Improper Privilege Management in Google gVisor
MediumCVE-2025-8916: CWE-770 Allocation of Resources Without Limits or Throttling in Legion of the Bouncy Castle Inc. Bouncy Castle for Java
MediumCVE-2025-8914: CWE-89 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') in WellChoose Organization Portal System
HighCVE-2025-8913: CWE-98 Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion') in WellChoose Organization Portal System
CriticalCVE-2025-8912: CWE-36 Absolute Path Traversal in WellChoose Organization Portal System
HighActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.