CVE-2025-8221

4.3 MEDIUM

📋 TL;DR

This vulnerability allows attackers to inject malicious scripts via the 'keyword' parameter in the goodsSearch function of JPACookieShop. When exploited, it enables reflected cross-site scripting attacks that can steal user sessions or redirect to malicious sites. All users of JPACookieShop up to commit 24a15c02b4f75042c9f7f615a3fed2ec1cefb999 are affected.

💻 Affected Systems

Products:
  • jerryshensjf JPACookieShop 蛋糕商城JPA版
Versions: All versions up to commit 24a15c02b4f75042c9f7f615a3fed2ec1cefb999
Operating Systems: Any
Default Config Vulnerable: ⚠️ Yes
Notes: This is a rolling release product, so specific version numbers are not available. All instances using the vulnerable commit or earlier are affected.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers steal administrator credentials, take over the e-commerce platform, and compromise customer payment information.

🟠

Likely Case

Attackers steal user session cookies to impersonate customers and make unauthorized purchases.

🟢

If Mitigated

Script execution is blocked by Content Security Policy, limiting impact to minor UI disruption.

🌐 Internet-Facing: HIGH
🏢 Internal Only: LOW

🎯 Exploit Status

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

Exploit details are publicly available in GitHub repositories. The vulnerability requires no authentication and is trivial to exploit with basic web testing tools.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: None known

Restart Required: No

Instructions:

Update to a version after commit 24a15c02b4f75042c9f7f615a3fed2ec1cefb999. Since this is a rolling release product, pull the latest code from the repository and rebuild.

🔧 Temporary Workarounds

Input Validation Filter

all

Add server-side validation to sanitize the 'keyword' parameter by removing HTML tags and JavaScript content

// In GoodsCustController.java, add: keyword = keyword.replaceAll("<[^>]*>", "").replaceAll("\\s*[\\"'`]\\s*", "")

Content Security Policy Header

all

Implement CSP headers to prevent script execution from untrusted sources

// Add to web configuration: response.setHeader("Content-Security-Policy", "default-src 'self'; script-src 'self'")

🧯 If You Can't Patch

  • Implement a Web Application Firewall (WAF) with XSS protection rules to filter malicious keyword parameters
  • Disable the goodsSearch functionality temporarily if not business-critical

🔍 How to Verify

Check if Vulnerable:

Test by accessing /goods/search?keyword=<script>alert('XSS')</script> and checking if script executes

Check Version:

git log --oneline -1

Verify Fix Applied:

After patching, test the same payload and verify no script execution occurs

📡 Detection & Monitoring

Log Indicators:

  • HTTP requests containing script tags in keyword parameter
  • Unusual search patterns with HTML/JavaScript content

Network Indicators:

  • HTTP GET requests with encoded script payloads in query parameters
  • Multiple rapid requests to goodsSearch endpoint

SIEM Query:

source="web_logs" AND uri_path="/goods/search" AND query_string="*<script>*"

🔗 References

📤 Share & Export