CVE-2023-46047

7.3 HIGH

📋 TL;DR

A local attacker can execute arbitrary code by providing a crafted configuration file to the sanei_configure_attach() function in Sane 1.2.1. This vulnerability requires local access to the system and the ability to control configuration files. The impact is limited to systems running vulnerable versions of Sane with attacker-controlled configuration files.

💻 Affected Systems

Products:
  • Sane (Scanner Access Now Easy)
Versions: 1.2.1
Operating Systems: Linux, Unix-like systems
Default Config Vulnerable: ✅ No
Notes: Requires attacker-controlled configuration file. The vulnerability is disputed as the product is not expected to start with malicious configuration files.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Local privilege escalation leading to full system compromise via arbitrary code execution.

🟠

Likely Case

Local user gains elevated privileges or executes malicious code within the Sane process context.

🟢

If Mitigated

No impact if configuration files are properly secured and not attacker-controlled.

🌐 Internet-Facing: LOW - Requires local access and control of configuration files.
🏢 Internal Only: MEDIUM - Local attackers with configuration file access could exploit this vulnerability.

🎯 Exploit Status

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

Exploit details available in public disclosures. Requires local access and ability to provide crafted configuration file.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Check GitLab issue for latest patched version

Vendor Advisory: https://gitlab.com/sane-project/backends/-/issues/708

Restart Required: Yes

Instructions:

1. Check GitLab issue #708 for patch details. 2. Update Sane to patched version. 3. Restart Sane services.

🔧 Temporary Workarounds

Secure Configuration Files

linux

Restrict write access to Sane configuration files to prevent attacker control.

chmod 644 /etc/sane.d/*.conf
chown root:root /etc/sane.d/*.conf

Disable Unnecessary Backends

linux

Disable Sane backends that are not required to reduce attack surface.

Comment out unnecessary backends in /etc/sane.d/dll.conf

🧯 If You Can't Patch

  • Implement strict file permissions on Sane configuration directories
  • Monitor for unauthorized changes to Sane configuration files

🔍 How to Verify

Check if Vulnerable:

Check Sane version: scanimage --version. If version is 1.2.1, system may be vulnerable.

Check Version:

scanimage --version

Verify Fix Applied:

Verify Sane version is updated beyond 1.2.1 and check GitLab issue #708 for patch confirmation.

📡 Detection & Monitoring

Log Indicators:

  • Sane process crashes
  • Unusual configuration file modifications

Network Indicators:

  • Local privilege escalation attempts

SIEM Query:

Process:scanimage AND (EventID:1000 OR ConfigurationFileModified)

🔗 References

📤 Share & Export