CVE-2004-1746 in PHP Code Snippet Libraryinfo

Summary

by MITRE

Cross-site scripting (XSS) vulnerability in index.php in PHP Code Snippet Library allows remote attackers to inject arbitrary web script or HTML via the (1) cat_select or (2) show parameters.

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 04/30/2025

The vulnerability identified as CVE-2004-1746 represents a classic cross-site scripting flaw within the PHP Code Snippet Library application. This security weakness exists in the index.php file and specifically affects two parameter inputs named cat_select and show. The vulnerability falls under the CWE-79 category of Cross-Site Scripting, which is one of the most prevalent and well-documented web application security flaws. Attackers can exploit this weakness to inject malicious web script or HTML content directly into the application's response, potentially compromising user sessions and data integrity.

The technical implementation of this vulnerability stems from insufficient input validation and output encoding within the PHP application's handling of user-supplied parameters. When the cat_select or show parameters are processed by index.php without proper sanitization, the application fails to escape special characters that could be interpreted as HTML or JavaScript code. This lack of proper input filtering creates an environment where malicious actors can craft payloads that execute in the context of other users' browsers. The vulnerability is particularly concerning because it allows remote attackers to inject arbitrary code without requiring any authentication or privileged access to the system.

The operational impact of this XSS vulnerability extends beyond simple script injection, potentially enabling attackers to perform session hijacking, deface web pages, steal sensitive information, or redirect users to malicious sites. When users interact with the vulnerable application, any malicious scripts injected through these parameters execute in their browsers, creating a persistent threat that can affect all users who view affected content. The vulnerability's remote exploitability means that attackers can launch attacks from any location without needing physical access to the target system, making it particularly dangerous in web-based environments where users interact with the application regularly.

Organizations should implement comprehensive input validation and output encoding mechanisms to prevent such vulnerabilities from occurring in their applications. The recommended mitigations include implementing strict parameter validation that rejects or sanitizes potentially dangerous characters, applying proper HTML escaping to all user-supplied content before rendering, and utilizing modern web application security frameworks that automatically handle these protections. Additionally, regular security testing including automated scanning and manual penetration testing should be conducted to identify and remediate similar vulnerabilities. This vulnerability aligns with ATT&CK technique T1531 which focuses on establishing persistence through malicious code injection, and demonstrates the critical importance of input sanitization in preventing web-based attacks.

Reservation

02/26/2005

Disclosure

12/31/2004

Moderation

accepted

Entry

VDB-22881

CPE

ready

Exploit

Download

EPSS

0.04969

KEV

no

Activities

very low

Sources

Want to know what is going to be exploited?

We predict KEV entries!