Crash instead of clean error parsing malformed CDL/CTF files (null derefs at CDLParser.cpp:355 and DynamicProperty.cpp:317)

Offen Anfängerfreundlich
#2,364 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
61/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
cpp
Bereich
security

Rechercherichtung

Beginne damit, src/OpenColorIO/fileformats/cdl/CDLParser.cpp um Zeile 355 und die beiden Stellen zu lesen, an denen m_parsingInfo zugewiesen wird (nahe :577 und :630), um zu sehen, warum ein leeres <ProcessList> es null lässt. Für den zweiten Absturz lies DynamicProperty.cpp:317 zusammen mit der Container-Behandlung in CTFReaderHelper.cpp:1742-1750, die einen Transform mit einer null Hue-Curve baut. Baue mit ASan, führe beide Reproduzierer aus dem Bericht aus (56-Byte- und 21-Byte-Dateien) und bestätige, dass das Ergebnis ein Parse-Fehler und kein SEGV ist. Beachte, dass die Reporter bereits Guard-Patches haben und PRs angeboten haben, also sprich vor dem Anfang mit einem Maintainer.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Summary

Fuzzing the file-reading paths of current master (22dd9c4, 2026-09-30)
found two null-pointer dereferences where malformed color files crash the
process instead of producing a clean parse error. Per SECURITY.md
("reading malformed data should produce an error, not a crash") these are
filed as bugs. Both are deterministic (5/5 each under ASan), no memory
corruption observed. We have two-line guard patches for both and are happy
to send PRs.

1. CDLParser::validateParsing dereferences null parsing info

Site: src/OpenColorIO/fileformats/cdl/CDLParser.cpp:355

const CDLTransformVec& pTransformList = getCDLParsingInfo()->m_transforms;

m_parsingInfo is only populated when CDL/CCC container elements are
parsed (CDLParser.cpp:577/:630). A <ProcessList> document whose body
never contains such an element leaves the info RcPtr null, and the line
above dereferences it. Minimal reproducer (56 bytes):

<ProcessList>
</ProcessList>

ASan: SEGV in CDLParser::Impl::validateParsing() const
(CDLParser.cpp:356), 5/5 deterministic; a valid CDL seed parses clean.
Suggested fix: null-check the parsing info and throw the standard parse
error instead.

2. Grading hue-curve dynamic property validates a null curve

Site: src/OpenColorIO/DynamicProperty.cpp:317

void DynamicPropertyGradingHueCurveImpl::setValue(const ConstGradingHueCurveRcPtr & value)
{
    value->validate();

With malformed input, the reader's grading path builds a transform whose
hue curve is a null ConstGradingHueCurveRcPtr (container handling around
CTFReaderHelper.cpp:1742-1750), and setValue calls validate() on it.
Minimal reproducer (21 bytes):

<ColorDecisionListn/>

(the typo'd root element is intentional; matching is by content, so the
file needs no particular extension). ASan: SEGV in
DynamicPropertyGradingHueCurveImpl::setValue, 5/5 deterministic.
Suggested fix: guard if (!value) throw ... or skip creating the dynamic
property when the curve is null.

Notes
  • Harness: parse-only driver over the file-format read path
    (GetCachedFileAndFormat), ASan + libFuzzer, no GPU/codegen.
  • Both PoCs are complete files, deterministic across 5 runs each; the
    56-byte and 21-byte contents above are the whole reproducers.
  • CWE-476, availability only; no corruption observed.
  • Found by our own fuzzing harness; analysis was AI-assisted.
Vorherrschende Sprache
C++
Sterne
2.1k
Forks
508
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus AcademySoftwareFoundation/OpenColorIO

Alle Issues in AcademySoftwareFoundation/OpenColorIO

Ähnliche Issues

Weitere Issues zu C++

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.