Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
library_name: orc
|
| 4 |
+
tags:
|
| 5 |
+
- security
|
| 6 |
+
- vulnerability-research
|
| 7 |
+
- huntr
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# WARNING: SECURITY RESEARCH — PROOF OF CONCEPT ONLY
|
| 11 |
+
|
| 12 |
+
This repository contains malformed/crafted Apache ORC files that trigger crashes (unbounded allocation, integer overflow) in ORC's C++ reader (`DictionaryLoader.cc` / `ColumnReader.cc` / `StripeStream.cc`). These are **passive data files**, not executable code — they do nothing on their own and only cause a crash/OOM/OOB-read when parsed by `orc::createReader()` / `RowReader::next()`.
|
| 13 |
+
|
| 14 |
+
**DO NOT** load these files with a production ORC build outside of an isolated, disposable research environment (memory exhaustion and memory-safety risk).
|
| 15 |
+
|
| 16 |
+
## Findings Summary
|
| 17 |
+
|
| 18 |
+
| File | Finding | CWE | Confirmation | Location |
|
| 19 |
+
|------|---------|-----|---------------|----------|
|
| 20 |
+
| `dictionary_wraparound_poc.orc` | Integer wraparound → zero-capacity buffer | CWE-190 | Prior art (EnigmaConsultant), included for reference | `DictionaryLoader.cc:67` |
|
| 21 |
+
| `dictionary_unbounded_alloc_poc.orc` | Unbounded allocation (~34GB) | CWE-789 | Fuzz-confirmed (1M+ execs, 6.5h) | `DictionaryLoader.cc:67` |
|
| 22 |
+
| `string_vectorbatch_resize_poc.orc` | Unbounded allocation (StringVectorBatch) | CWE-789 | Fuzz-confirmed | `ColumnReader.cc:743` |
|
| 23 |
+
| `string_direct_reader_resize_poc.orc` | Unbounded allocation (StringDirectColumnReader) | CWE-789 | Fuzz-confirmed | `ColumnReader.cc:743` |
|
| 24 |
+
| `stripestream_offset_overflow_poc.orc` | Integer overflow → OOB read | CWE-190/CWE-125 | Manually-confirmed (protobuf-valid PoC) | `StripeStream.cc:94` |
|
| 25 |
+
|
| 26 |
+
**Note:** `dictionary_wraparound_poc.orc` reproduces a previously-documented finding by EnigmaConsultant (HuggingFace: [`EnigmaConsultant/orc-dictionary-overflow`](https://huggingface.co/EnigmaConsultant/orc-dictionary-overflow)) and is included here only for completeness/context, **not as a novel claim**. The other four files represent this report's independent contributions.
|
| 27 |
+
|
| 28 |
+
## Reproduction
|
| 29 |
+
|
| 30 |
+
```bash
|
| 31 |
+
# Build ORC C++ from source (HEAD a6f12fd)
|
| 32 |
+
# Compile with ASan+UBSan for crash detection
|
| 33 |
+
clang++ -std=c++17 -fsanitize=address,undefined -g -O1 \
|
| 34 |
+
-I/path/to/orc/c++/include -I/path/to/orc/build/c++/include \
|
| 35 |
+
-c fuzzer_harness.cc -o fuzzer_harness.o
|
| 36 |
+
|
| 37 |
+
clang++ -fsanitize=address,undefined -g -O1 \
|
| 38 |
+
fuzzer_harness.o /path/to/orc/build/c++/src/liborc.a \
|
| 39 |
+
/path/to/orc/build/_deps/protobuf-build/liborc_vendored_protobuf.a \
|
| 40 |
+
/path/to/orc/build/_deps/snappy-build/liborc_vendored_snappy.a \
|
| 41 |
+
/path/to/orc/build/_deps/zstd-build/lib/liborc_vendored_zstd.a \
|
| 42 |
+
/path/to/orc/build/_deps/lz4-build/liborc_vendored_lz4.a \
|
| 43 |
+
/path/to/orc/build/_deps/zlib-build/liborc_vendored_zlib.a \
|
| 44 |
+
-lz -ldl -lpthread -o fuzzer_harness
|
| 45 |
+
|
| 46 |
+
# Test each PoC
|
| 47 |
+
./fuzzer_harness dictionary_unbounded_alloc_poc.orc
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
A minimal fuzzer harness that calls `orc::createReader()` + `RowReader::next()` is sufficient to reproduce all findings.
|
| 51 |
+
|
| 52 |
+
## Full Report
|
| 53 |
+
|
| 54 |
+
See `report.md` in this repository for the complete vulnerability report with ASan stack traces, root cause analysis, and code-level detail per finding.
|
| 55 |
+
|
| 56 |
+
## Credits
|
| 57 |
+
|
| 58 |
+
- @drogba771 — Discovery, fuzzing, PoC, analysis
|
| 59 |
+
- EnigmaConsultant — Prior art for the wraparound scenario (CWE-190)
|
| 60 |
+
|
| 61 |
+
## Timeline
|
| 62 |
+
|
| 63 |
+
- 2026-07-19: Fuzzing campaign (6.5h, 3 AFL++ workers, 1M+ execs)
|
| 64 |
+
- 2026-07-19: All 4 findings confirmed
|