CVE-2023-39007

9.6 CRITICAL

📋 TL;DR

This vulnerability allows cross-site scripting (XSS) attacks in OPNsense firewall management interfaces. Attackers can inject malicious scripts via the cron job configuration interface, potentially compromising administrator sessions. Affects OPNsense Community Edition before 23.7 and Business Edition before 23.4.2.

💻 Affected Systems

Products:
  • OPNsense Community Edition
  • OPNsense Business Edition
Versions: Community Edition: <23.7, Business Edition: <23.4.2
Operating Systems: OPNsense (FreeBSD-based)
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists in default cron component configuration. Requires authenticated access to management interface to exploit.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete compromise of firewall management, credential theft, lateral movement to internal networks, and installation of persistent backdoors.

🟠

Likely Case

Session hijacking of administrator accounts, unauthorized configuration changes, and potential data exfiltration from the management interface.

🟢

If Mitigated

Limited to session disruption or minor configuration tampering if proper input validation and output encoding are implemented.

🌐 Internet-Facing: HIGH if management interface is exposed to internet, as XSS can be triggered remotely.
🏢 Internal Only: MEDIUM if only accessible internally, requiring attacker to be on network or trick authenticated user.

🎯 Exploit Status

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

Exploit requires authenticated access to cron configuration interface. Public technical details available in references.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Community Edition: 23.7+, Business Edition: 23.4.2+

Vendor Advisory: https://github.com/opnsense/core/commit/5edff49db1cd8b5078611e2f542d91c02af2b25c

Restart Required: No

Instructions:

1. Log into OPNsense web interface. 2. Navigate to System > Firmware > Updates. 3. Click 'Check for updates'. 4. Install available updates. 5. Confirm version is 23.7+ (Community) or 23.4.2+ (Business).

🔧 Temporary Workarounds

Disable Cron Component Access

all

Temporarily restrict access to cron configuration interface

# Configure firewall rules to restrict access to management interface
# Use role-based access control to limit who can modify cron jobs

Input Validation Enhancement

linux

Add custom input validation for cron job parameters

# Modify /usr/local/opnsense/mvc/app/controllers/OPNsense/Cron/ItemController.php
# Add proper sanitization for openAction parameter

🧯 If You Can't Patch

  • Restrict management interface access to trusted IP addresses only using firewall rules.
  • Implement web application firewall (WAF) with XSS protection rules.

🔍 How to Verify

Check if Vulnerable:

Check OPNsense version via web interface (System > Firmware > Status) or CLI: 'opnsense-version'

Check Version:

opnsense-version

Verify Fix Applied:

Confirm version is 23.7+ (Community) or 23.4.2+ (Business). Check commit 5edff49db1cd8b5078611e2f542d91c02af2b25c is applied.

📡 Detection & Monitoring

Log Indicators:

  • Unusual cron configuration changes
  • Multiple failed login attempts followed by cron access
  • Suspicious JavaScript in cron job parameters

Network Indicators:

  • Unexpected requests to /ui/cron/item/open with script tags
  • Outbound connections from management interface to unknown destinations

SIEM Query:

source="opnsense" AND (uri="/ui/cron/item/open" AND (user_agent CONTAINS "script" OR referer CONTAINS "javascript:"))

🔗 References

📤 Share & Export