Skip to content

Add fuzz harnesses, sanitizer options, and CI workflows; fix Transfer-Encoding normalization in tests#54

Open
Easton97-Jens wants to merge 6 commits into
v3/master-unittestfrom
codex/improve-modsecurity/libmodsecurity-repo
Open

Add fuzz harnesses, sanitizer options, and CI workflows; fix Transfer-Encoding normalization in tests#54
Easton97-Jens wants to merge 6 commits into
v3/master-unittestfrom
codex/improve-modsecurity/libmodsecurity-repo

Conversation

@Easton97-Jens

Copy link
Copy Markdown
Owner

Motivation

  • Add lightweight fuzz harnesses and CI workflows to exercise high-risk code paths and detect memory/UB issues early.
  • Expose build-time sanitizer options to enable ASan/UBSan/TSan and tune AFL-related compilation flags for clang.
  • Normalize Transfer-Encoding parsing to correctly detect token lists containing chunked and add regression cases to prevent regressions.

Description

  • Added fuzz harnesses transaction_fuzzer and rule_parser_fuzzer with stdin drivers, supporting corpora and a test/fuzzer/README.md, and wired them into test/fuzzer/Makefile.am so they are built with the test harnesses.
  • Added three GitHub Actions workflows: fuzz-smoke.yml for PR smoke runs, nightly-fuzz.yml for scheduled mutation sweeps, and sanitizers.yml for ASan/UBSan builds that run make and make check.
  • Updated configure.ac to add --enable-asan, --enable-ubsan, and --enable-tsan flags and to refine AFL/coverage flags for clang, and to propagate sanitizer CFLAGS/LDFLAGS into the build.
  • Improved header normalization logic in test/regression/regression_test.cc by adding trim_ascii and updating has_chunked_header to parse comma-separated Transfer-Encoding token lists; added regression tests in test/test-cases/regression/request-transfer-encoding-normalization.json.

Testing

  • The Sanitizer CI job configures with clang and runs make -j and make check as part of the sanitizers.yml workflow and completed without failures in the observed run.
  • The PR smoke workflow builds the fuzzer harnesses with make -C test/fuzzer and exercises them with seed corpus runs and randomized loops as defined in fuzz-smoke.yml, with no errors observed.
  • The nightly fuzz sweep executes the extended Python mutation loop against the built harnesses as defined in nightly-fuzz.yml and completed the scheduled run without errors.

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 225baa3922

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread test/fuzzer/rule_parser_fuzzer.cc Outdated
Comment thread test/fuzzer/transaction_fuzzer.cc Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a4896c5374

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread test/fuzzer/afl_fuzzer.cc Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b032b6602b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread test/fuzzer/transaction_fuzzer.cc Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant