CVE-2024-46241

5.9 MEDIUM

📋 TL;DR

This vulnerability allows attackers to inject malicious scripts via the pname parameter in PHPGurukul Dairy Farm Shop Management System. When exploited, it enables cross-site scripting attacks that can steal session cookies, redirect users, or deface pages. Administrators and users accessing the affected pages are at risk.

💻 Affected Systems

Products:
  • PHPGurukul Dairy Farm Shop Management System
Versions: v1.1
Operating Systems: Any OS running PHP
Default Config Vulnerable: ⚠️ Yes
Notes: Requires access to add_product.php or edit_product.php pages, typically admin interfaces.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers steal administrator session cookies, gain full system control, compromise user data, and potentially pivot to other systems.

🟠

Likely Case

Session hijacking of authenticated users, credential theft, or defacement of product management pages.

🟢

If Mitigated

Limited to reflected XSS impact with proper input validation and output encoding in place.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires access to product management functions, typically requiring authentication. Public proof-of-concept available on GitHub.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: Not available

Restart Required: No

Instructions:

1. Implement proper input validation for pname parameter
2. Apply output encoding when displaying pname values
3. Update to latest version if available from vendor

🔧 Temporary Workarounds

Input Validation Filter

all

Add server-side validation to sanitize pname parameter input

// In add_product.php and edit_product.php, add:
$pname = htmlspecialchars($_POST['pname'], ENT_QUOTES, 'UTF-8');

🧯 If You Can't Patch

  • Implement WAF rules to block XSS payloads in pname parameter
  • Restrict access to add_product.php and edit_product.php to trusted IPs only

🔍 How to Verify

Check if Vulnerable:

Test by submitting <script>alert('XSS')</script> in pname parameter and check if script executes

Check Version:

Check system version in admin panel or readme files

Verify Fix Applied:

Test same payload and verify it's properly encoded or blocked

📡 Detection & Monitoring

Log Indicators:

  • Unusual script tags in pname parameter logs
  • Multiple failed product addition attempts

Network Indicators:

  • HTTP requests with script tags in POST data to affected endpoints

SIEM Query:

source="web_logs" AND (uri="/add_product.php" OR uri="/edit_product.php") AND post_data MATCHES "<script>"

🔗 References

📤 Share & Export