Skip to content
Memory corruption Advisory Advanced CVE-2018-3846

NASA CFITSIO Multiple Stack Overflow Code Execution Vulnerabilities

Multiple stack-based buffer overflows exist in the CFITSIO library's parsing of FITS image headers, caused by unbounded sprintf calls that write user-controlled keyword names or values into fixed-size buffers. An attacker could deliver a crafted FITS image to trigger these overflows and potentially achieve code execution.

Tyler Bohan Follow

Originally disclosed on Cisco Talos

High 8.8 View original

Multiple exploitable buffer overflow vulnerabilities exist in image parsing functionality of the CFITSIO library version 3.42. Specially crafted images parsed via the library, can cause a stack-based buffer overflow overwriting arbitrary data.

Tyler Bohan, on Cisco Talos

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker could potentially gain code execution by delivering a specially crafted FITS image to a victim.

What the attacker needed

Victim opens a crafted FITS image

The fix

The vendor patched the vulnerabilities, likely by replacing sprintf with bounded functions such as snprintf.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A buffer overflow happens when a program writes more data into a fixed-size memory area than it can hold, spilling over into nearby memory. Here, the CFITSIO library copies text from an image file into a small buffer without checking length, so a malicious image can overwrite important data and possibly let an attacker run their own code.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More by Tyler Bohan

View all

84 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.