---
id: "CVE-2026-115504"
kind: "vulnerability"
aliases: ["CVE-2026-115504"]
title: "CFITSIO: crafted FITS file overflows buffer in ffgcls2, enabling code execution"
severity: "high"
cvss: 8.5
epss: 0.00135
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["astronomy", "c", "cfitsio", "fits-processing", "package", "self-hosted"]
not_affected_if: ["cfitsio-not-linked", "no-untrusted-fits-input"]
published_at: "2026-10-22T20:17:06+00:00"
first_seen_at: "2026-10-23T21:57:32+00:00"
updated_at: "2026-10-25T03:00:18+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-115504", "first_seen_at": "2026-10-23T21:57:32+00:00"}, {"source": "epss", "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-115504", "first_seen_at": "2026-10-24T07:15:51+00:00"}]
---

# CFITSIO: crafted FITS file overflows buffer in ffgcls2, enabling code execution

CFITSIO through 4.7.0 has an out-of-bounds write in ffgcls2() in getcols.c, which trusts heap descriptor lengths for variable-length string columns. A crafted FITS file overflows a fixed stack buffer and the caller's string array, which the sources say enables arbitrary code execution.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the CFITSIO version linked into your application or library (look for `4.7.0` or earlier in your dependency manifests or build files; the sources do not give a command)
- unknown for other checks: the sources do not say which programs call ffgcls2() or read untrusted FITS files

## Fix

- Move CFITSIO past 4.7.0 once a fixed release is available; the sources do not name a fixed version
- Until patched, do not open FITS files from untrusted sources with CFITSIO-based tools (unknown whether a workaround exists)

## Timeline

- 2026-10-23T21:57:32+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-115504
- 2026-10-24T07:15:51+00:00 epss https://api.first.org/data/v1/epss?cve=CVE-2026-115504

## From the sources

CFITSIO through 4.7.0 contains an out-of-bounds write vulnerability in ffgcls2() in getcols.c that trusts attacker-controlled heap descriptor lengths for variable-length string columns. Attackers can supply a crafted FITS file that overflows a fixed 28,800-byte stack buffer and the caller's string array, enabling arbitrary code execution.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
