CVE-2022-43357

7.5 HIGH

📋 TL;DR

A stack overflow vulnerability in libsass's CompoundSelector::has_real_parent_ref function allows attackers to cause denial of service by crashing the application. This affects libsass (a C/C++ Sass compiler) and sassc (its command-line driver), potentially impacting any software using these libraries for Sass compilation.

💻 Affected Systems

Products:
  • libsass
  • sassc
Versions: libsass 3.6.5-8-g210218 and earlier, sassc 3.6.2 and earlier
Operating Systems: All platforms running affected libsass/sassc versions
Default Config Vulnerable: ⚠️ Yes
Notes: Any application or service using vulnerable libsass versions for Sass compilation is affected, including web frameworks, build tools, and CMS platforms with Sass processing capabilities.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete service disruption through application crash, potentially affecting web development pipelines or services that process user-provided Sass/SCSS files.

🟠

Likely Case

Denial of service through application crash when processing maliciously crafted Sass/SCSS files, disrupting compilation workflows.

🟢

If Mitigated

Limited impact if proper input validation and sandboxing are implemented, with crashes contained to isolated processes.

🌐 Internet-Facing: MEDIUM - Exploitable if applications accept user-uploaded Sass/SCSS files for processing, but requires specific compilation workflows.
🏢 Internal Only: MEDIUM - Development pipelines and build systems using vulnerable libsass versions are at risk from malicious code injection.

🎯 Exploit Status

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

Proof-of-concept exploit code is available in the GitHub issue. Exploitation requires the ability to submit malicious Sass/SCSS files for compilation.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: libsass versions after commit addressing issue #3177

Vendor Advisory: https://github.com/sass/libsass/issues/3177

Restart Required: Yes

Instructions:

1. Update libsass to a patched version from the official repository. 2. Rebuild any applications using libsass. 3. Update sassc if using the command-line tool. 4. Restart affected services.

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Implement strict validation of Sass/SCSS input files before passing to libsass compilation

Process Isolation

all

Run libsass compilation in isolated containers or sandboxed environments to contain crashes

🧯 If You Can't Patch

  • Implement network segmentation to isolate systems using vulnerable libsass versions
  • Deploy application-level firewalls to block malicious Sass/SCSS file uploads

🔍 How to Verify

Check if Vulnerable:

Check libsass version: `sassc --version` or examine linked library version in applications

Check Version:

sassc --version  # or check libsass library version in build configuration

Verify Fix Applied:

Verify updated to libsass version after the fix commit for issue #3177

📡 Detection & Monitoring

Log Indicators:

  • Application crashes with segmentation faults during Sass compilation
  • Unusual memory usage patterns in libsass processes

Network Indicators:

  • Multiple failed compilation requests from single sources
  • Unusual Sass/SCSS file upload patterns

SIEM Query:

process.name:"sassc" AND event.action:"crash" OR process.name:"libsass" AND memory.usage:>threshold

🔗 References

📤 Share & Export