Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 99535fb70c049d79f9eb0d40c54e3d5b5c1e503b
      
https://github.com/WebKit/WebKit/commit/99535fb70c049d79f9eb0d40c54e3d5b5c1e503b
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-09-24 (Thu, 24 Sep 2026)

  Changed paths:
    M Source/WebCore/platform/network/RFC8941.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/HTTPParsers.cpp

  Log Message:
  -----------
  RFC8941 parseKey rejects keys beginning with "*"
https://bugs.webkit.org/show_bug.cgi?id=325111
rdar://188260300

Reviewed by Alex Christensen.

Parsing a Key per RFC 9651 section 4.2.3.3 [1] allows the first character
to be lcalpha or "*" (key = ( lcalpha / "*" ) *( lcalpha / DIGIT / "_" /
"-" / "." / "*" )).

parseKey() gated the first character on isASCIILower() alone, omitting
the "*" alternative, so any Dictionary member key or parameter key
beginning with "*" was rejected. Because callers treat a null key as a
fatal error, this discarded the entire structured field (e.g. "*foo=1"
or "count=42; *note=?1"). The trailing-character matcher (isEndOfKey)
already permits "*", so only the leading-character check was wrong.

Accept "*" as a valid first key character.

[1] https://datatracker.ietf.org/doc/html/rfc9651#name-parsing-a-key

Test: Tools/TestWebKitAPI/Tests/WebCore/HTTPParsers.cpp

* Source/WebCore/platform/network/RFC8941.cpp:
(RFC8941::parseKey):  Allow "*" as the first character.
* Tools/TestWebKitAPI/Tests/WebCore/HTTPParsers.cpp:
(TestWebKitAPI::TEST(RFC8941, ParseDictionaryStructuredFieldValue)):
Add coverage for "*"-initial dictionary and parameter keys.

Canonical link: https://commits.webkit.org/321835@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to