-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Remote Code Execution vulnerability in LibreCAD 2.2.0-rc3 (JWW CDataList) #1464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
bug
An error which causes unexpected or unintended results
Comments
eldstal
added a commit
to eldstal/LibreCAD
that referenced
this issue
Dec 18, 2021
This fixes issue LibreCAD#1464
lordofbikes
added a commit
that referenced
this issue
Jan 4, 2022
Added bounds check to CDataList in JWW parser (Issue #1464)
fixed with #1465 |
This vulnerability has been assigned CVE-2021-45342. |
LeSuisse
added a commit
to LeSuisse/nixpkgs
that referenced
this issue
Jan 30, 2022
13 tasks
github-actions bot
pushed a commit
to NixOS/nixpkgs
that referenced
this issue
Feb 1, 2022
LibreCAD/LibreCAD#1464 (cherry picked from commit 6896348)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Vulnerable Products
Steps to reproduce or sample file
Start LibreCAD 2.2.0 in a debugger
File/Open...
Unzip and open the attached proof-of-concept file
Observe
ACCESS_VIOLATION
crash, witheip=0x41414141
(AAAA)Screenshot:
Cause
The
CDataList
entity deserialization inLibreCAD/libraries/jwwlib/src/jwwdoc.h
is vulnerable to a stack buffer overflow.char buf[512]
declared inCDataList::Serialize()
on line 784 is of fixed size 512. One variety ofCDataList
provides its own size field, as seen on line 795 and no bounds checking is performed. This allows an attacker to overflowbuf
and overwrite other stack variables, including the return address.The attached PoC file is tuned to trigger this behavior in the latest windows release of LibreCAD, but the same bug is also present
in older versions and on other platforms.
Note: This is similar to, but distinct from issue #1462
Impact
An attacker can craft a JW-CAD input file and thereby gain control over execution flow (EIP controlled directly).
This allows an attacker to run arbitrary code on the system running LibreCAD, with the privileges of the current user.
Proposed Mitigation
CDataList::Serialize()
, and refuse to load more data tobuf
than actually supported.Operating System and LibreCAD version info
Version: 2.2.0-rc3
Compiler: GNU GCC 7.3.0
Compiled on: Nov 29 2021
Qt Version: 5.12.4
Boost Version: 1.65.1
System: Windows 10 (10.0)
The text was updated successfully, but these errors were encountered: