Skip to content

Add fuzz targets for OSS-Fuzz integration (RLE + FormulaParser)#1020

Open
vishalcoc44 wants to merge 5 commits intoapache:trunkfrom
vishalcoc44:add-rle-fuzz-target
Open

Add fuzz targets for OSS-Fuzz integration (RLE + FormulaParser)#1020
vishalcoc44 wants to merge 5 commits intoapache:trunkfrom
vishalcoc44:add-rle-fuzz-target

Conversation

@vishalcoc44
Copy link

@vishalcoc44 vishalcoc44 commented Mar 3, 2026

Hi @centic9,

I'm contributing two fuzz targets for integration with Google's OSS-Fuzz continuous fuzzing platform. The OSS-Fuzz maintainers have requested that they be upstreamed.

  1. POIRleFuzzer for RLEDecompressingInputStream

  2. FormulaParserFuzzer for FormulaParser.parse()

    • Targets the recursive-descent formula parser, which had low fuzz coverage.
    • Found that malformed nested brackets ([[) cause a RuntimeException ("Parsed past the end of the formula") instead of a proper FormulaParseException (confirmed in POI 5.2.3).
    • Includes a dictionary file with Excel formula tokens to help guide the fuzzer.
    • Reproduction: FormulaParser.parse("[[", workbook, FormulaType.CELL, -1)
    • Related OSS-Fuzz PR: [apache-poi] Add targeted FormulaParser fuzzer google/oss-fuzz#14977

Thanks for taking the time to review.

@vishalcoc44 vishalcoc44 changed the title Add RLE decompression fuzz target for OSS-Fuzz integration Add fuzz targets for OSS-Fuzz integration (RLE + FormulaParser) Mar 3, 2026
Copy link
Member

@pjfanning pjfanning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 2 files need Apache source headers like the ones in existing files in this repo. The Google copyright in one file. Is this needed? Provide full details if yes.

If you we do need a Google copyright then you need to also update the LICENSE file in this repo to mention this file with Google copyright code.

@vishalcoc44
Copy link
Author

These 2 files need Apache source headers like the ones in existing files in this repo. The Google copyright in one file. Is this needed? Provide full details if yes.

If you we do need a Google copyright then you need to also update the LICENSE file in this repo to mention this file with Google copyright code.

Thanks @pjfanning! I've addressed both points:

  1. Replaced Google copyright headers with standard Apache ASF headers.
  2. Moved all fuzz files to their own package: org.apache.poi.fuzz. Please take another look!

@pjfanning pjfanning dismissed their stale review March 4, 2026 11:30

changes made

@vishalcoc44
Copy link
Author

Hey @pjfanning there were some build errors due to the jazzer api . I've made the required changes.

  • Add com.code-intelligence:jazzer-api dependency to poi/build.gradle
  • Update poi/src/test/java9/module-info.java for JPMS compatibility
  • Configure Ant build.xml to download and include jazzer-api in test classpath
  • Add **/*.dict to Apache RAT excludes in root build.gradle to fix license audit

requires org.junit.jupiter.api;
requires org.junit.jupiter.params;
requires org.mockito;
requires static com.code_intelligence.jazzer.api;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's not do this - move the code out of here into its own module if this is needed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you even host this change yourself? Why does this code need to be in POI repo. It can be in any arbitrary Git repo.

@pjfanning
Copy link
Member

If you want to proceed with this PR in this repo, don't update the Ant build. It is already a millstone around our necks and it doesn't need to support everything. Don't break the Ant build but if we add a new poi-fuzz module then we don't need the Ant build to support it. Concentrate on the Gradle build.

@vishalcoc44 vishalcoc44 requested a review from pjfanning March 4, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants