Safeguard
Vulnerability Analysis•

CVE-2023-26157: Medium Out-of-Bounds Read in libredwg

CVE-2023-26157 is a medium out-of-bounds read in libredwg before 0.12.5.6384 that can crash programs reading DWG files. Upgrade to 0.12.5.6384 or later.

Safeguard Security Team
4 min read

CVE-2023-26157 is a medium severity (CVSS 5.5) denial of service in libredwg, the GNU library that reads and writes AutoCAD DWG files. An out-of-bounds read in decode_r2007.c can crash a program. Versions before 0.12.5.6384 are affected, so upgrade to 0.12.5.6384 or later.

What's affected

The record says libredwg versions before 0.12.5.6384 are affected. The Snyk entry referenced by the record says the same and tells users to upgrade libredwg to 0.12.5.6384 or higher. The two agree. Snyk also scores it 5.5, matching the record, so there is no severity conflict.

The cause is an out-of-bounds read involving section->num_pages in decode_r2007.c, the code that handles the R2007 DWG format. The upstream fix is a small commit in the LibreDWG repository, titled "decode_r2007: fix fuzzing out-of-bounds", which resets an invalid section->num_pages value. It closes GitHub issue 850, whose title describes an out-of-bound read in read_data_section in version 0.12.5. The commit message mentions fuzzing, so the flaw was found through malformed inputs, not through a reported attack.

The listed weaknesses are CWE-125, out-of-bounds read, and CWE-400, uncontrolled resource consumption. The vector is local, low complexity, low privileges, no user interaction, with only availability affected.

How to check if you're exposed

libredwg is a C library, so it often arrives indirectly through a distribution package or a tool that bundles it, such as a converter or viewer. Check what your systems have:

dpkg -l | grep -i libredwg
rpm -qa | grep -i libredwg
ldconfig -p | grep -i redwg

If you build from source or vendor the code in a repository, search for decode_r2007.c in your tree and compare your copy with the upstream fix commit c8cf03c. For containers, scan the image contents rather than the host. The free dependency scan on Gold works on manifests, and an SBOM from your build shows bundled copies that a package manager would not list.

To see which of your own applications pull in affected components, run the free in-browser dependency scan at gold.safeguard.sh/scan.

What to do now

  1. Find every place libredwg is installed or vendored, including inside container images.
  2. Upgrade to 0.12.5.6384 or later, or to your distribution package that includes the fix.
  3. Rebuild and redeploy any application that statically links the library.
  4. Until then, do not feed untrusted DWG files to services that use libredwg.
  5. Run a dependency scan again to confirm the old version is gone.

Why it matters

An out-of-bounds read happens when code uses a size or index from the file without checking it against the real buffer. The program then reads past the end of its data. Here the visible effect described by the advisory is a denial of service: the process crashes.

File parsers deserve attention because the input is usually untrusted. A service that converts uploaded drawings can be crashed by a single bad file if it uses an unpatched copy. The record does not mark the CVE as known exploited in CISA KEV, and the sources describe only a crash.

Try it yourself

Click through it at your own pace, or open it full screen.

Quick check

Does this allow code execution?

The sources describe a denial of service from an out-of-bounds read. They do not claim code execution.

How do I find bundled copies?

Check distribution packages, container images and vendored source. An SBOM or a dependency scan lists them.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

We email you a link to confirm, and only then add you to the list. Unsubscribe in one click. Privacy

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.