Arbitrary Code Execution in Cppcheck

cppcheck Updated 02 Oct 2025

Summary

11/09/2023
N/A
No i
High
7.8

CVE-2023-39070: An issue in Cppcheck 2.12 dev allows a local attacker to execute arbitrary code via the removeContradiction parameter in token.cpp:1934. Affects cppcheck versions < f2f1fb0bca5f23aac8f02fb9c09e4529a7935749. No fix is published. How to fix ↓

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

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Cppcheck is an open-source static analysis tool for C/C++ code. It is designed to detect various types of bugs and potential vulnerabilities in source code. The tool analyzes the code and provides detailed reports on potential issues. However, a vulnerability has been discovered in Cppcheck version 2.12 dev that allows a local attacker to execute arbitrary code.

Vulnerability Detail

The vulnerability (CVE-2023-39070) originates from a flaw in the 'token.cpp' file of Cppcheck. Specifically, the 'removeContradiction' parameter at line 1934 is not properly validated, leading to the possibility of executing arbitrary code. An attacker with local access to the system can exploit this vulnerability to execute malicious code, potentially gaining unauthorized access, modifying data, or causing other harmful consequences.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

Currently, no known workarounds exist for this vulnerability. It is crucial to apply the recommended fix by updating to a patched version of Cppcheck.

Conclusion

In conclusion, Cppcheck version 2.12 dev is vulnerable to arbitrary code execution due to a flaw in the 'token.cpp' file. Users are advised to update to a patched version of Cppcheck to mitigate the risk. Regularly updating software dependencies is also recommended to ensure the latest security patches are applied. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for cppcheck →

Share this vulnerability

FAQ

Cppcheck is an open-source static analysis tool used for detecting bugs and vulnerabilities in C/C++ code.

The vulnerability allows a local attacker to execute arbitrary code, potentially leading to unauthorized access, data manipulation, or other malicious activities.

To fix this vulnerability, update Cppcheck to a version that includes the necessary patches.

Currently, no known workarounds exist for this vulnerability. Updating to a patched version is the recommended solution.

There is no known public exploitation of this vulnerability at the time of this report. However, it is crucial to apply the recommended fix to mitigate any potential risks.

Related vulnerabilities

Recent vulnerabilities recorded for cppcheck.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. 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