Skip to content

HTML API: Fixes for issues discovered while fuzzing.#11982

Open
dmsnell wants to merge 1 commit into
WordPress:trunkfrom
dmsnell:html-api/fuzzer-fixes
Open

HTML API: Fixes for issues discovered while fuzzing.#11982
dmsnell wants to merge 1 commit into
WordPress:trunkfrom
dmsnell:html-api/fuzzer-fixes

Conversation

@dmsnell
Copy link
Copy Markdown
Member

@dmsnell dmsnell commented May 27, 2026

Trac ticket: Core-65372

Fuzz-testing was performed against the HTML API for finding edge cases
that might be broken in the existing parsing code. A few issues were
discovered with HTML normalization and warnings from out-of-bounds
string reads.

This patch contains new tests catching regressions on these behaviors
and adds fixes for the discovered issues.

A special-case for FORM closing tags inside TABLEs was added after
investigation turned up that many normalization issues stem from this
single issue, where next_tag() would already fail to proceed, but the
normalization was continuing with already-created virtual tokens. This
special-case should be investigated as more support is added to the HTML
API to ensure that it couldn’t be removed for more robust core code.

@dmsnell dmsnell force-pushed the html-api/fuzzer-fixes branch from d0d323a to b44f02f Compare May 27, 2026 07:54
@github-actions
Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@dmsnell dmsnell force-pushed the html-api/fuzzer-fixes branch 3 times, most recently from 7d47eb5 to c9990f9 Compare May 30, 2026 08:34
@dmsnell dmsnell changed the title HTML API: Fixes from fuzz testing. HTML API: Fixes for issues discovered while fuzzing. May 30, 2026
@dmsnell dmsnell marked this pull request as ready for review May 30, 2026 08:36
@github-actions
Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props dmsnell.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@dmsnell dmsnell force-pushed the html-api/fuzzer-fixes branch from c9990f9 to 568d467 Compare May 30, 2026 08:53
Fuzz-testing was performed against the HTML API for finding edge cases
that might be broken in the existing parsing code. A few issues were
discovered with HTML normalization and warnings from out-of-bounds
string reads.

This patch contains new tests catching regressions on these behaviors
and adds fixes for the discovered issues.

A special-case for FORM closing tags inside TABLEs was added after
investigation turned up that many normalization issues stem from this
single issue, where `next_tag()` would already fail to proceed, but the
normalization was continuing with already-created virtual tokens. This
special-case should be investigated as more support is added to the HTML
API to ensure that it couldn’t be removed for more robust core code.
@dmsnell dmsnell force-pushed the html-api/fuzzer-fixes branch from 568d467 to 6548ed9 Compare May 30, 2026 08:55
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.

1 participant