Skip to content

Add OSS-Fuzz fuzzing harness under test/fuzzing/#2088

Merged
ai merged 2 commits into
postcss:mainfrom
rootvector2:add-oss-fuzz-harness
May 11, 2026
Merged

Add OSS-Fuzz fuzzing harness under test/fuzzing/#2088
ai merged 2 commits into
postcss:mainfrom
rootvector2:add-oss-fuzz-harness

Conversation

@rootvector2

Copy link
Copy Markdown
Contributor

Adds a Jazzer.js fuzzing harness and CSS token dictionary under test/fuzzing/, as requested in google/oss-fuzz#15468 by the OSS-Fuzz maintainer (DavidKorczynski) and per @ai's suggestion to put them in test/fuzzing/.

  • fuzz_parse.js — drives postcss.parse, AST walk, stringify/re-parse round-trip, postcss().process, JSON round-trip, and postcss.list helpers via @jazzer.js/core.
  • fuzz_parse.dict — libFuzzer dictionary of common CSS tokens.
    test/ is already in .npmignore, so this does not affect the published npm package.

"+"
"~"
"::"
"&"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We may add source map comment token as separated token here (if I understand fuzzing duct right).

We had many issues in source map parsing. It can be useful for fuzzing to be able to quicker get into source map parsing branch.

Comment thread test/fuzzing/fuzz_parse.js Outdated
////////////////////////////////////////////////////////////////////////////////

const { FuzzedDataProvider } = require('@jazzer.js/core');
const postcss = require('../../lib/postcss');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you please run pnpm dlx oxfmt to use project's code format here?

@ai ai merged commit 0700dac into postcss:main May 11, 2026
9 of 10 checks passed
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