CVE-2021-21260

7.6 HIGH

📋 TL;DR

This stored cross-site scripting (XSS) vulnerability in Online Invoicing System version 4.0 allows attackers to inject malicious scripts into item descriptions. When an admin views these items, the script can extract CSRF tokens and change the admin's password, leading to account takeover. All users running OIS version 4.0 are affected.

💻 Affected Systems

Products:
  • Online Invoicing System (OIS)
Versions: Version 4.0 specifically
Operating Systems: All platforms running OIS
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects version 4.0; earlier versions may have different vulnerabilities but not this specific one.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete compromise of the admin account, allowing attacker to access all system data, modify invoices, steal sensitive business information, and potentially pivot to other systems.

🟠

Likely Case

Admin account takeover leading to unauthorized access to financial data, invoice manipulation, and potential data exfiltration.

🟢

If Mitigated

Limited impact with proper input validation and output encoding, potentially only minor data leakage if other controls exist.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires ability to create or modify items (typically authenticated user), but admin viewing is required for full impact.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 4.2

Vendor Advisory: https://github.com/bigprof-software/online-invoicing-system/security/advisories/GHSA-rm79-5596-r7q4

Restart Required: No

Instructions:

1. Backup your current OIS installation and database. 2. Download version 4.2 from the official GitHub releases. 3. Replace all files with the new version. 4. Verify the app/items_view.php file contains proper output encoding.

🔧 Temporary Workarounds

Input Validation Filter

all

Add server-side validation to sanitize item description inputs before storage

Implement HTML entity encoding for all user inputs in item description fields

Content Security Policy

all

Implement CSP headers to restrict script execution

Add 'Content-Security-Policy: script-src 'self'' to HTTP headers

🧯 If You Can't Patch

  • Restrict item creation/modification permissions to trusted users only
  • Implement web application firewall rules to block XSS payloads in item descriptions

🔍 How to Verify

Check if Vulnerable:

Check if running OIS version 4.0 by examining version files or checking the admin interface version display

Check Version:

Check the version.txt file or view the footer in the admin interface

Verify Fix Applied:

Test item description field with XSS payloads like <script>alert('test')</script> and verify they are properly encoded when displayed

📡 Detection & Monitoring

Log Indicators:

  • Unusual item creation/modification patterns
  • Admin password change requests from unexpected sources
  • Script tags in item description fields

Network Indicators:

  • HTTP requests containing script payloads in POST data to item endpoints
  • Unexpected password reset requests

SIEM Query:

source="web_logs" AND (uri_path="/app/items_view.php" OR uri_path LIKE "%/items/%") AND (http_method="POST" OR http_method="PUT") AND (request_body LIKE "%<script>%" OR request_body LIKE "%javascript:%")

🔗 References

📤 Share & Export