CVE-2022-43357: Stack Overflow Vulnerability in libsass

sass Updated 02 Oct 2025

Summary

06/03/2024
Yes i
High
Not published

CVE-2022-43357: Stack overflow vulnerability in ast_selectors.cpp in function Sass::CompoundSelector::has_real_parent_ref in libsass:3.6.5-8-g210218, which can be exploited by attackers to causea denial of service (DoS). Affects sass versions >= 3.6.5-8-g210218, < 3.6.5. Fixed in 3.6.5. How to fix ↓

Also tracked for

The same CVE-2022-43357 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

libsass is an open-source library that provides a C/C++ implementation of a Sass compiler. It is commonly used to process Sass files and generate CSS output. The library is widely adopted in various projects and frameworks due to its efficiency and compatibility. However, a stack overflow vulnerability has been discovered in libsass version 3.6.5-8-g210218, which can be exploited by attackers to cause a denial of service (DoS) attack. This vulnerability also affects the command line driver for libsass, sassc version 3.6.2.

Vulnerability Detail

The vulnerability resides in the ast_selectors.cpp file, specifically in the function Sass::CompoundSelector::has_real_parent_ref. By exploiting this vulnerability, an attacker can trigger a stack overflow, leading to a crash or unresponsive behavior of the affected application. This can result in a denial of service, disrupting the normal operation of the application. The vulnerability has a high severity score according to the CVSS v3 rating system.

How To Fix

Minimum fixed version

3.6.5

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no specific workaround mentioned for this vulnerability. However, as a general best practice, it is recommended to implement proper input validation and sanitization techniques to mitigate the risk of stack overflow vulnerabilities. Additionally, regularly updating the software components and libraries used in the application can help prevent such vulnerabilities.

Conclusion

In conclusion, the stack overflow vulnerability in libsass version 3.6.5-8-g210218 can lead to a denial of service (DoS) attack. It is crucial to update to a patched version of libsass and sassc to mitigate this vulnerability. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for sass →

Share this vulnerability

FAQ

libsass is an open-source library that provides a C/C++ implementation of a Sass compiler. It is widely used to process Sass files and generate CSS output.

This vulnerability can be exploited by attackers to cause a denial of service (DoS) attack, resulting in the application becoming unresponsive or crashing.

The vulnerability affects libsass version 3.6.5-8-g210218. It is recommended to update to a version beyond this release.

Yes, the sassc command line driver version 3.6.2 is also affected by this vulnerability. It is recommended to update to a newer version.

To mitigate the risk of stack overflow vulnerabilities, it is important to implement proper input validation and sanitization techniques. Regularly updating software components and libraries can also help prevent such vulnerabilities.

Related vulnerabilities

Recent vulnerabilities recorded for sass.

How To Fix

Minimum fixed version

3.6.5

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback