PT-2024-3969 · Yii2 · Yii2

Antiphishing

·

Published

2024-05-30

·

Updated

2024-06-02

·

CVE-2024-32877

CVSS v3.1

4.7

Medium

VectorAV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
Name of the Vulnerable Software and Affected Versions Yii2 versions 2.0.49.3 and earlier
Description The issue lies in the mechanism for displaying function argument values in the stack trace, specifically when an argument's value exceeds 32 characters. The vulnerability manifests when an attacker induces an exception in the application, leading to a stack trace page being displayed. The use of a double quote (") allows an attacker to break out of the title attribute's value context and inject their own attributes into the span tag, including malicious JavaScript code through event handlers such as onmousemove. This vulnerability allows an attacker to execute arbitrary JavaScript code in the security context of the victim's site via a specially crafted link, potentially leading to the theft of cookies, content substitution, or complete takeover of user accounts.
Recommendations For versions 2.0.49.3 and earlier, upgrade to version 2.0.50 to address the vulnerability. As a temporary workaround, consider modifying the htmlEncode method in the ErrorHandler.php file to effectively prevent the XSS vulnerability while maintaining the targeted functionality of the previous changes. The suggested modification is to change the htmlEncode method to use htmlspecialchars($text, ENT QUOTES | ENT SUBSTITUTE | ENT HTML5, 'UTF-8').

Exploit

Fix

XSS

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

BDU:2024-04384
CVE-2024-32877
GHSA-QG5R-95M4-MJGJ

Affected Products

Yii2