Repository navigation
Add a fuzzer for ext/uri - #24725
Open
yumasansansan wants to merge 1 commit into
Open
Add a fuzzer for ext/uri#24725yumasansansan wants to merge 1 commit into
yumasansansan wants to merge 1 commit into
Conversation
The fuzzer parses its input with Uri\Rfc3986\Uri and Uri\WhatWg\Url, calls every getter, equals(), toString() and friends, and, if the input contains a newline, passes the rest to resolve() and the with*() methods. The input is also passed to parse_url().
yumasansansan
force-pushed
the
fuzzer-uri
branch
from
October 26, 2026 08:01
1e8509e to
ad1285d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ext/uri(PHP 8.5) is always built, but no fuzzer targets it. In the OSS-Fuzz coverage report of 2026-10-24,ext/uri/(including the bundled uriparser) has 3.79% line coverage (325/8569, 30/451 functions),ext/lexbor/0.61%, andext/standard/url.c3.46%.php-fuzz-uri:\nand a string forresolve()and thewith*()methods. The WHATWG parser removes tabs and newlines from its input, so little is lost by using a newline as separator.Uri\Rfc3986\Uri::parse()andUri\WhatWg\Url::parse()(the latter with the$errorsout parameter), then all getters,toString()/toRawString()ortoAsciiString()/toUnicodeString(),__serialize(),__debugInfo(),equals().resolve()and eachwith*()method with the second part of the input; when they return an object, it is converted to a string.parse_url()with the URI.sapi/fuzzer/corpus/uri(picked up by the OSS-Fuzzbuild.sh, which zips every directory insapi/fuzzer/corpus).Replaying only the seed corpus (no fuzzing) reaches 91 functions of the ext/uri glue code, 69 functions of the bundled uriparser and 44 functions of lexbor's URL parser.
ext/uricannot be disabled, so the fuzzer is built unconditionally, like the JSON fuzzer.