feat(libSceNKWebKit): implement simple cross-origin request checks #18805

Merged
AlexWhitehouse merged 3 commits from upstream-pr/18805 into main 2026-11-17 23:00:15 +00:00
AlexWhitehouse commented 2026-11-12 10:40:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlexWhitehouse on 2026-11-12T10:40:57Z.


What

libSceNKWebKit WebCore::isSimpleCrossOriginAccessRequest(const String&, const HTTPHeaderMap&) (_ZN7WebCore32isSimpleCrossOriginAccessRequestERKN3WTF6StringERKNS_13HTTPHeaderMapE, NID eNFR5wiR41Y) threw not implemented. This PR ports it from the PS5 WebKit tree the other NKWebKit ports use, 80f77e94:

The new src/CrossOriginRequest.cpp starts with those files' notices.

Behaviour:

  • Method: only GET, HEAD and POST qualify, compared case-sensitively as upstream.
  • Headers: every header in the map must be a known HTTPHeaderName that is safe with its value. Any uncommon (unnamed) header fails, as upstream.
    • Any value longer than 128 code units fails.
    • Accept: no CORS-unsafe bytes.
    • Accept-Language and Content-Language: only alphanumerics and *,-.;=.
    • Content-Type: no CORS-unsafe bytes, a valid MIME-sniff content type (through the existing isValidContentType export), and a MIME type of application/x-www-form-urlencoded, multipart/form-data or text/plain, case-insensitively.
    • Range: a single bytes=start-[end] range with no spaces or tabs, as isSimpleRangeHeaderValue checks. The range parser is private to this file, so the separate parseRange export (#18175) isn't touched.
    • Every other header fails.
  • Errors: a header map whose storage is null while it reports entries, or a header name outside the enum, throws.

The stub and its inventory row are removed, and a debt entry records that the console's ABI is unverified.

Tested

  • New test: nkwebkit_crossoriginrequest (core/libs/prx/libSceNKWebKit/tests/CrossOriginRequest.cpp) runs 1,383 checks covering:
    • each method, including lowercase and other methods;
    • each safelisted header with safe and unsafe values, every CORS-unsafe byte, and the 128-code-unit limit on both sides;
    • content types with parameters, whitespace and case variants;
    • valid and invalid ranges;
    • unknown and uncommon headers, an empty map, and 8-bit and UTF-16 values.
  • Linux x86-64 (Ubuntu 26.04, GCC 15, Release):
    • on main, the test fails with …isSimpleCrossOriginAccessRequest… not implemented;
    • with this PR, nkwebkit_crossoriginrequest, nkwebkit_contenttypevalidation, nkwebkit_wtf and public_headers pass.
  • Windows 11 (build 26300, WinLibs MinGW-w64 GCC 15.2.0 UCRT, Release): nkwebkit_crossoriginrequest, nkwebkit_wtf and public_headers pass at e99b27fe72, with no compiler warnings in the changed files. The branch was then rebased onto current main, where an include line and the count line conflicted. I also removed a second copy of this PR's debt entry that the original commit had added by mistake. The focused tests pass again on Linux.
  • Mutation check: changing the length limit from 128 to 129 fails 10 checks.
  • python3 tools/check_conventions.py --base origin/main: all checks passed.
  • python3 tools/pr_overlap.py: no open PR implements this export, its helpers or the new files. I compared every NKWebKit PR it couldn't compare automatically. #18175's parseRange hunks aren't touched. Other NKWebKit PRs touch the same files but not this export.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5275876939 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18805). Originally posted by [AlexWhitehouse](https://github.com/AlexWhitehouse) on 2026-11-12T10:40:57Z. --- ### What libSceNKWebKit `WebCore::isSimpleCrossOriginAccessRequest(const String&, const HTTPHeaderMap&)` (`_ZN7WebCore32isSimpleCrossOriginAccessRequestERKN3WTF6StringERKNS_13HTTPHeaderMapE`, NID `eNFR5wiR41Y`) threw `not implemented`. This PR ports it from the PS5 WebKit tree the other NKWebKit ports use, 80f77e94: - [`CrossOriginAccessControl.cpp`](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/loader/CrossOriginAccessControl.cpp): the request check; - [`HTTPParsers.cpp`](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/platform/network/HTTPParsers.cpp): `isCrossOriginSafeRequestHeader` and the per-header rules; - [`ParsedContentType.cpp`](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/platform/network/ParsedContentType.cpp): the content-type parse. The new `src/CrossOriginRequest.cpp` starts with those files' notices. Behaviour: - **Method:** only `GET`, `HEAD` and `POST` qualify, compared case-sensitively as upstream. - **Headers:** every header in the map must be a known `HTTPHeaderName` that is safe with its value. Any uncommon (unnamed) header fails, as upstream. - Any value longer than 128 code units fails. - `Accept`: no CORS-unsafe bytes. - `Accept-Language` and `Content-Language`: only alphanumerics and ` *,-.;=`. - `Content-Type`: no CORS-unsafe bytes, a valid MIME-sniff content type (through the existing `isValidContentType` export), and a MIME type of `application/x-www-form-urlencoded`, `multipart/form-data` or `text/plain`, case-insensitively. - `Range`: a single `bytes=start-[end]` range with no spaces or tabs, as `isSimpleRangeHeaderValue` checks. The range parser is private to this file, so the separate `parseRange` export (#18175) isn't touched. - Every other header fails. - **Errors:** a header map whose storage is null while it reports entries, or a header name outside the enum, throws. The stub and its inventory row are removed, and a debt entry records that the console's ABI is unverified. ### Tested - **New test:** `nkwebkit_crossoriginrequest` (`core/libs/prx/libSceNKWebKit/tests/CrossOriginRequest.cpp`) runs 1,383 checks covering: - each method, including lowercase and other methods; - each safelisted header with safe and unsafe values, every CORS-unsafe byte, and the 128-code-unit limit on both sides; - content types with parameters, whitespace and case variants; - valid and invalid ranges; - unknown and uncommon headers, an empty map, and 8-bit and UTF-16 values. - **Linux x86-64** (Ubuntu 26.04, GCC 15, Release): - on `main`, the test fails with `…isSimpleCrossOriginAccessRequest… not implemented`; - with this PR, `nkwebkit_crossoriginrequest`, `nkwebkit_contenttypevalidation`, `nkwebkit_wtf` and `public_headers` pass. - **Windows 11** (build 26300, WinLibs MinGW-w64 GCC 15.2.0 UCRT, Release): `nkwebkit_crossoriginrequest`, `nkwebkit_wtf` and `public_headers` pass at e99b27fe72, with no compiler warnings in the changed files. The branch was then rebased onto current `main`, where an include line and the count line conflicted. I also removed a second copy of this PR's debt entry that the original commit had added by mistake. The focused tests pass again on Linux. - **Mutation check:** changing the length limit from 128 to 129 fails 10 checks. - `python3 tools/check_conventions.py --base origin/main`: all checks passed. - **`python3 tools/pr_overlap.py`:** no open PR implements this export, its helpers or the new files. I compared every NKWebKit PR it couldn't compare automatically. #18175's `parseRange` hunks aren't touched. Other NKWebKit PRs touch the same files but not this export. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
PrivacyOnion commented 2026-11-12 10:49:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-12T10:49:33Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against ba2fadfff7:

  • Conventions: tools/check_conventions.py passed; git diff --check reported whitespace errors.
  • Build: nkwebkit_crossoriginrequest_tests built cleanly.
  • CTest (nkwebkit_crossoriginrequest):
    1/1 Test #3751: nkwebkit_crossoriginrequest ......   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified _ZN7WebCore32isSimpleCrossOriginAccessRequestERKN3WTF6StringERKNS_13HTTPHeaderMapE in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp correctly enforces case-sensitive method checks (GET, HEAD, POST) and throws std::invalid_argument for null storage buffers and out-of-bounds HTTPHeaderName enum indices.
    • Verified CodeUnits in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp handles null StringImpl, 8-bit (hashAndFlags & 4), and 16-bit character buffers without memory corruption or out-of-bounds indexing.
    • Verified CORS-unsafe byte validation (IsUnsafe) and length limits (<= 128 code units) in IsSafeHeader across Accept, AcceptLanguage, ContentLanguage, and ContentType headers.
    • Verified ContentType parsing delegates valid MIME type checking to _ZN7WebCore18isValidContentTypeERKN3WTF6StringENS_4ModeE with Mode::MimeSniff and properly compares case-insensitive safelisted types (application/x-www-form-urlencoded, multipart/form-data, text/plain).
    • Verified 64-bit integer overflow protection and sign handling in ParseInteger for long long limits (LLONG_MIN and LLONG_MAX) in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp.
    • Verified header map inventory accounting in docs/dev/debt/libSceNKWebKit.md and stub removal in core/libs/prx/libSceNKWebKit/Export.cpp.
  • Concerns:
    • core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:201: In IsSafeRange, end is initialized to -1 to represent an omitted end offset (such as in bytes=0-). When endText is explicitly "-1" (as in bytes=0--1), ParseInteger(endText) succeeds and returns -1, leaving end = -1. Line 207 checks (end == -1 || end >= *start), which matches the sentinel and returns true, erroneously treating negative end offsets as open-ended ranges. Upstream WebCore (HTTPParsers.cpp:isSimpleRangeHeaderValue) checks !(*end < *start), rejecting negative offsets (-1 < 0). Furthermore, core/libs/prx/libSceNKWebKit/tests/CrossOriginRequest.cpp:97 asserts {HTTPHeaderName::Range, u"bytes=0--1", true}, codifying this bug in the unit test.
  • Minor: please drop the Generated with footer from the description; the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5873089732 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18805#pullrequestreview-5873089732). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-12T10:49:33Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `ba2fadfff7`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` reported whitespace errors. - **Build**: `nkwebkit_crossoriginrequest_tests` built cleanly. - **CTest** (`nkwebkit_crossoriginrequest`): ``` 1/1 Test #3751: nkwebkit_crossoriginrequest ...... Passed 0.01 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceNKWebKit/Export.cpp`, `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`, `core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified _ZN7WebCore32isSimpleCrossOriginAccessRequestERKN3WTF6StringERKNS_13HTTPHeaderMapE in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp correctly enforces case-sensitive method checks (GET, HEAD, POST) and throws std::invalid_argument for null storage buffers and out-of-bounds HTTPHeaderName enum indices. - Verified CodeUnits in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp handles null StringImpl, 8-bit (hashAndFlags & 4), and 16-bit character buffers without memory corruption or out-of-bounds indexing. - Verified CORS-unsafe byte validation (IsUnsafe) and length limits (<= 128 code units) in IsSafeHeader across Accept, AcceptLanguage, ContentLanguage, and ContentType headers. - Verified ContentType parsing delegates valid MIME type checking to _ZN7WebCore18isValidContentTypeERKN3WTF6StringENS_4ModeE with Mode::MimeSniff and properly compares case-insensitive safelisted types (application/x-www-form-urlencoded, multipart/form-data, text/plain). - Verified 64-bit integer overflow protection and sign handling in ParseInteger for long long limits (LLONG_MIN and LLONG_MAX) in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp. - Verified header map inventory accounting in docs/dev/debt/libSceNKWebKit.md and stub removal in core/libs/prx/libSceNKWebKit/Export.cpp. - **Concerns**: - core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:201: In IsSafeRange, `end` is initialized to `-1` to represent an omitted end offset (such as in `bytes=0-`). When `endText` is explicitly `"-1"` (as in `bytes=0--1`), `ParseInteger(endText)` succeeds and returns `-1`, leaving `end = -1`. Line 207 checks `(end == -1 || end >= *start)`, which matches the sentinel and returns `true`, erroneously treating negative end offsets as open-ended ranges. Upstream WebCore (HTTPParsers.cpp:isSimpleRangeHeaderValue) checks `!(*end < *start)`, rejecting negative offsets (-1 < 0). Furthermore, core/libs/prx/libSceNKWebKit/tests/CrossOriginRequest.cpp:97 asserts `{HTTPHeaderName::Range, u"bytes=0--1", true}`, codifying this bug in the unit test. - Minor: please drop the `Generated with` footer from the description; the AI-assisted checkbox can stay. Requesting changes for the points above.
PrivacyOnion commented 2026-11-12 11:05:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-12T11:05:00Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 91883b268a:

  • Conventions: tools/check_conventions.py passed; git diff --check reported whitespace errors.
  • Build: nkwebkit_crossoriginrequest_tests built cleanly.
  • CTest (nkwebkit_crossoriginrequest):
    1/1 Test #3751: nkwebkit_crossoriginrequest ......   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Method validation in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: verified that WebCore::isSimpleCrossOriginAccessRequest strictly checks method for GET, HEAD, and POST case-sensitively, rejecting all other methods.
    • HTTPHeaderMap storage safety and ABI validation in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: confirmed that null storage with non-zero size (headers.common and headers.uncommon) and out-of-bounds HTTPHeaderName indices throw std::invalid_argument, while any uncommon headers trigger rejection.
    • String decoding and character safety in CodeUnits (core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp): verified null string handling, detection of null data pointers in non-empty StringImpl instances, and correct 8-bit unsigned char vs 16-bit char16_t decoding via the hashAndFlags & 4 branch.
    • CORS-safelisted header validation in IsSafeHeader and IsUnsafe (core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp): verified the 128 code-unit length cap, character rules for Accept-Language and Content-Language, CORS-unsafe byte detection, and case-insensitive MIME-type checks for application/x-www-form-urlencoded, multipart/form-data, and text/plain using the WebCore::Mode::MimeSniff export.
    • Range parser and numeric bounds in IsSafeRange and ParseInteger (core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp): checked whitespace rejection (space and tab), bytes= prefix parsing, dash separation, and safe 64-bit integer parsing avoiding overflow UB for boundaries up to LLONG_MAX and LLONG_MIN.
    • Repository conventions and technical debt: verified removal of the stub from Export.cpp and InventoryExports.hpp, exact decrement of the inventory count from 5970 to 5969, proper documentation in docs/dev/debt/libSceNKWebKit.md, and adherence to the zero-comments rule across all changed files.
  • Minor: please drop the Generated with footer from the description; the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5873285419 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18805#pullrequestreview-5873285419). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-12T11:05:00Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `91883b268a`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` reported whitespace errors. - **Build**: `nkwebkit_crossoriginrequest_tests` built cleanly. - **CTest** (`nkwebkit_crossoriginrequest`): ``` 1/1 Test #3751: nkwebkit_crossoriginrequest ...... Passed 0.01 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceNKWebKit/Export.cpp`, `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`, `core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Method validation in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: verified that WebCore::isSimpleCrossOriginAccessRequest strictly checks method for GET, HEAD, and POST case-sensitively, rejecting all other methods. - HTTPHeaderMap storage safety and ABI validation in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: confirmed that null storage with non-zero size (headers.common and headers.uncommon) and out-of-bounds HTTPHeaderName indices throw std::invalid_argument, while any uncommon headers trigger rejection. - String decoding and character safety in CodeUnits (core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp): verified null string handling, detection of null data pointers in non-empty StringImpl instances, and correct 8-bit unsigned char vs 16-bit char16_t decoding via the hashAndFlags & 4 branch. - CORS-safelisted header validation in IsSafeHeader and IsUnsafe (core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp): verified the 128 code-unit length cap, character rules for Accept-Language and Content-Language, CORS-unsafe byte detection, and case-insensitive MIME-type checks for application/x-www-form-urlencoded, multipart/form-data, and text/plain using the WebCore::Mode::MimeSniff export. - Range parser and numeric bounds in IsSafeRange and ParseInteger (core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp): checked whitespace rejection (space and tab), bytes= prefix parsing, dash separation, and safe 64-bit integer parsing avoiding overflow UB for boundaries up to LLONG_MAX and LLONG_MIN. - Repository conventions and technical debt: verified removal of the stub from Export.cpp and InventoryExports.hpp, exact decrement of the inventory count from 5970 to 5969, proper documentation in docs/dev/debt/libSceNKWebKit.md, and adherence to the zero-comments rule across all changed files. - Minor: please drop the `Generated with` footer from the description; the AI-assisted checkbox can stay. Requesting changes for the points above.
PrivacyOnion commented 2026-11-12 11:35:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-12T11:35:31Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 183e2bf853:

  • Conventions: tools/check_conventions.py passed; git diff --check reported whitespace errors.
  • Build: nkwebkit_crossoriginrequest_tests built cleanly.
  • CTest (nkwebkit_crossoriginrequest):
    1/1 Test #3753: nkwebkit_crossoriginrequest ......   Passed    0.03 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:CodeUnits: Verified null checks on String::impl, valid character extraction for both 8-bit (unsigned char) and UTF-16 (char16_t) representations, and throwing std::invalid_argument when length is non-zero but data buffer is null.
    • core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:ParseInteger: Verified signed 64-bit integer parsing, ASCII whitespace stripping, overflow bounds checking against std::numeric_limits::max() and min(), and safe handling of negative and positive signs.
    • core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:IsSafeRange: Verified single range parsing, case-insensitive bytes prefix check, rejection of spaces and tabs, dash position bounds safety, and proper acceptance of open-ended and signed range endpoints matching WebKit release source.
    • core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:IsSafeHeader: Verified 128-code-unit value length guard, CORS-unsafe byte validation for Accept and Content-Type, strict character whitelist for Accept-Language and Content-Language, and MIME-sniff content type validation via _ZN7WebCore18isValidContentTypeERKN3WTF6StringENS_4ModeE.
    • core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:_ZN7WebCore32isSimpleCrossOriginAccessRequestERKN3WTF6StringERKNS_13HTTPHeaderMapE: Verified case-sensitive simple method matching (GET, HEAD, POST), valid enum range checks against headerNames.size(), null common/uncommon storage detection throwing std::invalid_argument, and rejection of uncommon headers.
    • core/libs/prx/libSceNKWebKit/tests/CrossOriginRequest.cpp: Verified test coverage spanning methods, 8-bit and 16-bit strings, 128-unit boundaries, all 256 byte values for CORS safety, MIME variants, range boundaries, uncommon headers, and exception behavior on corrupt storage.
  • Minor: please drop the Generated with footer from the description; the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5873709757 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18805#pullrequestreview-5873709757). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-12T11:35:31Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `183e2bf853`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` reported whitespace errors. - **Build**: `nkwebkit_crossoriginrequest_tests` built cleanly. - **CTest** (`nkwebkit_crossoriginrequest`): ``` 1/1 Test #3753: nkwebkit_crossoriginrequest ...... Passed 0.03 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceNKWebKit/Export.cpp`, `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`, `core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:CodeUnits: Verified null checks on String::impl, valid character extraction for both 8-bit (unsigned char) and UTF-16 (char16_t) representations, and throwing std::invalid_argument when length is non-zero but data buffer is null. - core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:ParseInteger: Verified signed 64-bit integer parsing, ASCII whitespace stripping, overflow bounds checking against std::numeric_limits<long long>::max() and min(), and safe handling of negative and positive signs. - core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:IsSafeRange: Verified single range parsing, case-insensitive bytes prefix check, rejection of spaces and tabs, dash position bounds safety, and proper acceptance of open-ended and signed range endpoints matching WebKit release source. - core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:IsSafeHeader: Verified 128-code-unit value length guard, CORS-unsafe byte validation for Accept and Content-Type, strict character whitelist for Accept-Language and Content-Language, and MIME-sniff content type validation via _ZN7WebCore18isValidContentTypeERKN3WTF6StringENS_4ModeE. - core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:_ZN7WebCore32isSimpleCrossOriginAccessRequestERKN3WTF6StringERKNS_13HTTPHeaderMapE: Verified case-sensitive simple method matching (GET, HEAD, POST), valid enum range checks against headerNames.size(), null common/uncommon storage detection throwing std::invalid_argument, and rejection of uncommon headers. - core/libs/prx/libSceNKWebKit/tests/CrossOriginRequest.cpp: Verified test coverage spanning methods, 8-bit and 16-bit strings, 128-unit boundaries, all 256 byte values for CORS safety, MIME variants, range boundaries, uncommon headers, and exception behavior on corrupt storage. - Minor: please drop the `Generated with` footer from the description; the AI-assisted checkbox can stay. Requesting changes for the points above.
PrivacyOnion commented 2026-11-12 12:50:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-12T12:50:11Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 09743a4cc2:

  • Conventions: tools/check_conventions.py passed; git diff --check reported whitespace errors.
  • Build: nkwebkit_crossoriginrequest_tests built cleanly.
  • CTest (nkwebkit_crossoriginrequest):
    1/1 Test #3762: nkwebkit_crossoriginrequest ......   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified null pointer and memory safety in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: CodeUnits safely handles null WTF::StringImpl instances and throws std::invalid_argument if characters are null with non-zero length, while isSimpleCrossOriginAccessRequest validates common and uncommon storage pointers before dereferencing and bounds-checks header.key against NKWebKit::HttpAbi::headerNames.size().
    • Verified integer overflow protection and range parsing in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: ParseInteger prevents 64-bit integer overflow via (limit - digit) / 10, properly supports LLONG_MIN and positive signs, and IsSafeRange correctly validates single-range boundaries and handles upstream-pinned signed endpoints (such as bytes=0--1).
    • Verified header validation logic in IsSafeHeader: strictly enforces the 128-code-unit limit, verifies CORS-unsafe bytes, restricts Accept-Language and Content-Language to alphanumerics and permitted punctuation ( *,-.;=), validates MIME types through _ZN7WebCore18isValidContentTypeERKN3WTF6StringENS_4ModeE, and rejects uncommon or non-safelisted headers.
    • Verified LP64 (Linux) vs LLP64 (Windows) portability: usage of explicit fixed-width integer types (long long, uint64_t, uint32_t, char16_t) and APS5_VABI ensures ABI stability across GCC, Clang, and MinGW-w64 without type narrowing or size discrepancies.
    • Verified compliance with AGENTS.md repository rules: zero comments in code (aside from required namespace closing comments), no hardcoded title special cases, proper debt recording and stub inventory count decrement in docs/dev/debt/libSceNKWebKit.md, and comprehensive unit tests in core/libs/prx/libSceNKWebKit/tests/CrossOriginRequest.cpp.
  • Minor: please drop the Generated with footer from the description; the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5874732899 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18805#pullrequestreview-5874732899). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-12T12:50:11Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `09743a4cc2`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` reported whitespace errors. - **Build**: `nkwebkit_crossoriginrequest_tests` built cleanly. - **CTest** (`nkwebkit_crossoriginrequest`): ``` 1/1 Test #3762: nkwebkit_crossoriginrequest ...... Passed 0.01 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceNKWebKit/Export.cpp`, `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`, `core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified null pointer and memory safety in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: CodeUnits safely handles null WTF::StringImpl instances and throws std::invalid_argument if characters are null with non-zero length, while isSimpleCrossOriginAccessRequest validates common and uncommon storage pointers before dereferencing and bounds-checks header.key against NKWebKit::HttpAbi::headerNames.size(). - Verified integer overflow protection and range parsing in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: ParseInteger prevents 64-bit integer overflow via (limit - digit) / 10, properly supports LLONG_MIN and positive signs, and IsSafeRange correctly validates single-range boundaries and handles upstream-pinned signed endpoints (such as bytes=0--1). - Verified header validation logic in IsSafeHeader: strictly enforces the 128-code-unit limit, verifies CORS-unsafe bytes, restricts Accept-Language and Content-Language to alphanumerics and permitted punctuation ( *,-.;=), validates MIME types through _ZN7WebCore18isValidContentTypeERKN3WTF6StringENS_4ModeE, and rejects uncommon or non-safelisted headers. - Verified LP64 (Linux) vs LLP64 (Windows) portability: usage of explicit fixed-width integer types (long long, uint64_t, uint32_t, char16_t) and APS5_VABI ensures ABI stability across GCC, Clang, and MinGW-w64 without type narrowing or size discrepancies. - Verified compliance with AGENTS.md repository rules: zero comments in code (aside from required namespace closing comments), no hardcoded title special cases, proper debt recording and stub inventory count decrement in docs/dev/debt/libSceNKWebKit.md, and comprehensive unit tests in core/libs/prx/libSceNKWebKit/tests/CrossOriginRequest.cpp. - Minor: please drop the `Generated with` footer from the description; the AI-assisted checkbox can stay. Requesting changes for the points above.
PrivacyOnion commented 2026-11-12 14:44:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-12T14:44:37Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 2fc6bcc5b8:

  • Conventions: tools/check_conventions.py passed; git diff --check reported whitespace errors.
  • Build: nkwebkit_crossoriginrequest_tests built cleanly.
  • CTest (nkwebkit_crossoriginrequest):
    1/1 Test #3768: nkwebkit_crossoriginrequest ......   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: verified pointer safety in CodeUnits and _ZN7WebCore32isSimpleCrossOriginAccessRequestERKN3WTF6StringERKNS_13HTTPHeaderMapE, confirming null StringImpl data, null common buffer, null uncommon buffer, and out-of-range HTTPHeaderName enum keys throw std::invalid_argument.
    • core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: verified method check strictly allows only case-sensitive GET, HEAD, and POST, rejecting other verbs, lowercase methods, and values with trailing whitespace.
    • core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: verified IsSafeHeader enforces the 128-code-unit length boundary, CORS-unsafe byte rejection for Accept, strict alphanumeric and punctuation safelist validation for AcceptLanguage and ContentLanguage, and rejects uncommon headers and unrecognized HTTPHeaderName entries.
    • core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: verified Content-Type processing rejects CORS-unsafe bytes, validates via WebCore::isValidContentType with Mode::MimeSniff, trims parameters and HTTP whitespace around semicolons, and case-insensitively restricts MIME types to application/x-www-form-urlencoded, multipart/form-data, and text/plain.
    • core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: verified IsSafeRange and ParseInteger forbid spaces and tabs, validate single 'bytes=start-[end]' ranges, prevent signed overflow on 64-bit boundaries (up to LLONG_MAX and LLONG_MIN), and reject suffix ranges.
    • core/libs/prx/libSceNKWebKit/Export.cpp, include/InventoryExports.hpp, and docs/dev/debt/libSceNKWebKit.md: verified clean removal of the NotImplemented stub, correct declaration in CrossOriginRequestExports.hpp, decrement of callable export debt count from 5962 to 5961, and absence of prohibited code comments.
  • Minor: please drop the Generated with footer from the description; the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5876398745 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18805#pullrequestreview-5876398745). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-12T14:44:37Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `2fc6bcc5b8`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` reported whitespace errors. - **Build**: `nkwebkit_crossoriginrequest_tests` built cleanly. - **CTest** (`nkwebkit_crossoriginrequest`): ``` 1/1 Test #3768: nkwebkit_crossoriginrequest ...... Passed 0.01 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceNKWebKit/Export.cpp`, `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`, `core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: verified pointer safety in CodeUnits and _ZN7WebCore32isSimpleCrossOriginAccessRequestERKN3WTF6StringERKNS_13HTTPHeaderMapE, confirming null StringImpl data, null common buffer, null uncommon buffer, and out-of-range HTTPHeaderName enum keys throw std::invalid_argument. - core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: verified method check strictly allows only case-sensitive GET, HEAD, and POST, rejecting other verbs, lowercase methods, and values with trailing whitespace. - core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: verified IsSafeHeader enforces the 128-code-unit length boundary, CORS-unsafe byte rejection for Accept, strict alphanumeric and punctuation safelist validation for AcceptLanguage and ContentLanguage, and rejects uncommon headers and unrecognized HTTPHeaderName entries. - core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: verified Content-Type processing rejects CORS-unsafe bytes, validates via WebCore::isValidContentType with Mode::MimeSniff, trims parameters and HTTP whitespace around semicolons, and case-insensitively restricts MIME types to application/x-www-form-urlencoded, multipart/form-data, and text/plain. - core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: verified IsSafeRange and ParseInteger forbid spaces and tabs, validate single 'bytes=start-[end]' ranges, prevent signed overflow on 64-bit boundaries (up to LLONG_MAX and LLONG_MIN), and reject suffix ranges. - core/libs/prx/libSceNKWebKit/Export.cpp, include/InventoryExports.hpp, and docs/dev/debt/libSceNKWebKit.md: verified clean removal of the NotImplemented stub, correct declaration in CrossOriginRequestExports.hpp, decrement of callable export debt count from 5962 to 5961, and absence of prohibited code comments. - Minor: please drop the `Generated with` footer from the description; the AI-assisted checkbox can stay. Requesting changes for the points above.
PrivacyOnion commented 2026-11-13 03:55:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-13T03:55:03Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against d89a635031:

  • Conventions: tools/check_conventions.py passed; git diff --check reported whitespace errors.
  • Build: nkwebkit_crossoriginrequest_tests built cleanly.
  • CTest (nkwebkit_crossoriginrequest):
    1/1 Test #3843: nkwebkit_crossoriginrequest ......   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified _ZN7WebCore32isSimpleCrossOriginAccessRequestERKN3WTF6StringERKNS_13HTTPHeaderMapE strictly restricts request methods to 'GET', 'HEAD', and 'POST', correctly checks for null common/uncommon storage pointers when sizes are non-zero, and throws std::invalid_argument on null buffer storage or invalid HTTPHeaderName enum indices.
    • Verified CodeUnits in src/CrossOriginRequest.cpp safely handles null WTF::StringImpl, throws std::invalid_argument when impl->length > 0 but impl->data is null, and correctly decodes both 8-bit (hashAndFlags & 4) and 16-bit char16_t character buffers.
    • Verified ParseInteger and IsSafeRange prevent integer overflow via (limit - digit) / 10, properly handle signed 64-bit boundaries (including LLONG_MIN and LLONG_MAX), and reject invalid range formats, tabs, spaces, and multi-range requests.
    • Verified IsSafeHeader correctly enforces the 128-code-unit limit, rejects CORS-unsafe bytes according to Fetch specifications, validates Content-Type via isValidContentType, and case-insensitively restricts Content-Type to application/x-www-form-urlencoded, multipart/form-data, and text/plain.
    • Verified LP64/LLP64 portability across Linux and Windows using fixed-width and long long types, and verified the implementation is reentrant with no concurrency or lifetime hazards.
    • Verified AGENTS.md compliance: no comments in code (verbatim upstream license notices explicitly approved by maintainer), stub removal and count decrement in docs/dev/debt/libSceNKWebKit.md, and comprehensive unit tests in tests/CrossOriginRequest.cpp.
  • Minor: please drop the Generated with footer from the description; the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5885765498 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18805#pullrequestreview-5885765498). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-13T03:55:03Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `d89a635031`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` reported whitespace errors. - **Build**: `nkwebkit_crossoriginrequest_tests` built cleanly. - **CTest** (`nkwebkit_crossoriginrequest`): ``` 1/1 Test #3843: nkwebkit_crossoriginrequest ...... Passed 0.01 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceNKWebKit/Export.cpp`, `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`, `core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified _ZN7WebCore32isSimpleCrossOriginAccessRequestERKN3WTF6StringERKNS_13HTTPHeaderMapE strictly restricts request methods to 'GET', 'HEAD', and 'POST', correctly checks for null common/uncommon storage pointers when sizes are non-zero, and throws std::invalid_argument on null buffer storage or invalid HTTPHeaderName enum indices. - Verified CodeUnits in src/CrossOriginRequest.cpp safely handles null WTF::StringImpl, throws std::invalid_argument when impl->length > 0 but impl->data is null, and correctly decodes both 8-bit (hashAndFlags & 4) and 16-bit char16_t character buffers. - Verified ParseInteger and IsSafeRange prevent integer overflow via (limit - digit) / 10, properly handle signed 64-bit boundaries (including LLONG_MIN and LLONG_MAX), and reject invalid range formats, tabs, spaces, and multi-range requests. - Verified IsSafeHeader correctly enforces the 128-code-unit limit, rejects CORS-unsafe bytes according to Fetch specifications, validates Content-Type via isValidContentType, and case-insensitively restricts Content-Type to application/x-www-form-urlencoded, multipart/form-data, and text/plain. - Verified LP64/LLP64 portability across Linux and Windows using fixed-width and long long types, and verified the implementation is reentrant with no concurrency or lifetime hazards. - Verified AGENTS.md compliance: no comments in code (verbatim upstream license notices explicitly approved by maintainer), stub removal and count decrement in docs/dev/debt/libSceNKWebKit.md, and comprehensive unit tests in tests/CrossOriginRequest.cpp. - Minor: please drop the `Generated with` footer from the description; the AI-assisted checkbox can stay. Requesting changes for the points above.
PrivacyOnion commented 2026-11-13 13:03:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-13T13:03:43Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 120914b08f:

  • Conventions: tools/check_conventions.py passed; git diff --check reported whitespace errors.
  • Build: nkwebkit_crossoriginrequest_tests built cleanly.
  • CTest (nkwebkit_crossoriginrequest):
    1/1 Test #3865: nkwebkit_crossoriginrequest ......   Passed    0.03 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: Verified _ZN7WebCore32isSimpleCrossOriginAccessRequestERKN3WTF6StringERKNS_13HTTPHeaderMapE validates method tokens case-sensitively against GET, HEAD, and POST, and bounds-checks HTTPHeaderName indices against NKWebKit::HttpAbi::headerNames.size() before dereferencing.
    • core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: Verified null-pointer and storage safety in CodeUnits, headers.common, and headers.uncommon, confirming invalid storage structures throw std::invalid_argument without memory leaks or buffer over-reads.
    • core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: Verified header safelist enforcement in IsSafeHeader, confirming the 128-code-unit limit, CORS-unsafe byte rejection, MIME-sniffing content-type validation, and single-range validation in IsSafeRange.
    • core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: Verified integer parsing in ParseInteger prevents 64-bit signed/unsigned overflow using (limit - digit) / 10 boundary checks across LLONG_MIN and LLONG_MAX.
    • core/libs/prx/libSceNKWebKit/tests/CrossOriginRequest.cpp and docs/dev/debt/libSceNKWebKit.md: Verified test coverage across 1,383 checks for wide and narrow representations, inventory count decrement to 5939, and technical debt documentation.
  • Minor: please drop the Generated with footer from the description; the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5891474702 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18805#pullrequestreview-5891474702). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-13T13:03:43Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `120914b08f`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` reported whitespace errors. - **Build**: `nkwebkit_crossoriginrequest_tests` built cleanly. - **CTest** (`nkwebkit_crossoriginrequest`): ``` 1/1 Test #3865: nkwebkit_crossoriginrequest ...... Passed 0.03 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceNKWebKit/Export.cpp`, `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`, `core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: Verified _ZN7WebCore32isSimpleCrossOriginAccessRequestERKN3WTF6StringERKNS_13HTTPHeaderMapE validates method tokens case-sensitively against GET, HEAD, and POST, and bounds-checks HTTPHeaderName indices against NKWebKit::HttpAbi::headerNames.size() before dereferencing. - core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: Verified null-pointer and storage safety in CodeUnits, headers.common, and headers.uncommon, confirming invalid storage structures throw std::invalid_argument without memory leaks or buffer over-reads. - core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: Verified header safelist enforcement in IsSafeHeader, confirming the 128-code-unit limit, CORS-unsafe byte rejection, MIME-sniffing content-type validation, and single-range validation in IsSafeRange. - core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: Verified integer parsing in ParseInteger prevents 64-bit signed/unsigned overflow using (limit - digit) / 10 boundary checks across LLONG_MIN and LLONG_MAX. - core/libs/prx/libSceNKWebKit/tests/CrossOriginRequest.cpp and docs/dev/debt/libSceNKWebKit.md: Verified test coverage across 1,383 checks for wide and narrow representations, inventory count decrement to 5939, and technical debt documentation. - Minor: please drop the `Generated with` footer from the description; the AI-assisted checkbox can stay. Requesting changes for the points above.
PrivacyOnion commented 2026-11-13 17:16:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-13T17:16:09Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against bda75ebb09:

  • Conventions: tools/check_conventions.py passed; git diff --check reported whitespace errors.
  • Build: nkwebkit_crossoriginrequest_tests built cleanly.
  • CTest (nkwebkit_crossoriginrequest):
    1/1 Test #3876: nkwebkit_crossoriginrequest ......   Passed    0.02 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified method filtering in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: strictly validates exact case-sensitive 'GET', 'HEAD', and 'POST', rejecting lowercase, unsupported methods, or methods with trailing whitespace.
    • Verified WTF::String conversion in CodeUnits (core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp): safely handles null WTF::StringImpl pointers, validates null data buffers when length > 0 throwing std::invalid_argument, and correctly unpacks both 8-bit Latin-1 (hashAndFlags & 4) and 16-bit UTF-16 character encodings.
    • Verified header safelist checks in IsSafeHeader (core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp): strictly enforces the 128-code-unit length limit, safely evaluates CORS-safelisted headers (Accept, AcceptLanguage, ContentLanguage, ContentType, Range), and rejects all other headers.
    • Verified Content-Type inspection in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: screens for CORS-unsafe bytes, delegates to _ZN7WebCore18isValidContentTypeERKN3WTF6StringENS_4ModeE with Mode::MimeSniff, trims MIME parameters/whitespace, and case-insensitively accepts only application/x-www-form-urlencoded, multipart/form-data, and text/plain.
    • Verified Range header validation in IsSafeRange and ParseInteger (core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp): rejects tab and space characters, guards against 64-bit integer overflow across signed long long boundaries, enforces non-negative start offsets, and adheres to pinned WebKit 80f77e94 range semantics.
    • Verified HTTPHeaderMap ABI safety in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: validates header.key against NKWebKit::HttpAbi::headerNames.size(), throws std::invalid_argument on null buffers reporting non-zero sizes, and rejects uncommon headers.
    • Verified repository conventions and AGENTS.md compliance: confirmed no in-code comments outside license blocks and namespace ends, properly updated technical debt and inventory count (5939 to 5938) in docs/dev/debt/libSceNKWebKit.md, and validated test rigor in core/libs/prx/libSceNKWebKit/tests/CrossOriginRequest.cpp.
  • Minor: please drop the Generated with footer from the description; the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5895200548 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18805#pullrequestreview-5895200548). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-13T17:16:09Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `bda75ebb09`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` reported whitespace errors. - **Build**: `nkwebkit_crossoriginrequest_tests` built cleanly. - **CTest** (`nkwebkit_crossoriginrequest`): ``` 1/1 Test #3876: nkwebkit_crossoriginrequest ...... Passed 0.02 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceNKWebKit/Export.cpp`, `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`, `core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified method filtering in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: strictly validates exact case-sensitive 'GET', 'HEAD', and 'POST', rejecting lowercase, unsupported methods, or methods with trailing whitespace. - Verified WTF::String conversion in CodeUnits (core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp): safely handles null WTF::StringImpl pointers, validates null data buffers when length > 0 throwing std::invalid_argument, and correctly unpacks both 8-bit Latin-1 (hashAndFlags & 4) and 16-bit UTF-16 character encodings. - Verified header safelist checks in IsSafeHeader (core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp): strictly enforces the 128-code-unit length limit, safely evaluates CORS-safelisted headers (Accept, AcceptLanguage, ContentLanguage, ContentType, Range), and rejects all other headers. - Verified Content-Type inspection in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: screens for CORS-unsafe bytes, delegates to _ZN7WebCore18isValidContentTypeERKN3WTF6StringENS_4ModeE with Mode::MimeSniff, trims MIME parameters/whitespace, and case-insensitively accepts only application/x-www-form-urlencoded, multipart/form-data, and text/plain. - Verified Range header validation in IsSafeRange and ParseInteger (core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp): rejects tab and space characters, guards against 64-bit integer overflow across signed long long boundaries, enforces non-negative start offsets, and adheres to pinned WebKit 80f77e94 range semantics. - Verified HTTPHeaderMap ABI safety in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: validates header.key against NKWebKit::HttpAbi::headerNames.size(), throws std::invalid_argument on null buffers reporting non-zero sizes, and rejects uncommon headers. - Verified repository conventions and AGENTS.md compliance: confirmed no in-code comments outside license blocks and namespace ends, properly updated technical debt and inventory count (5939 to 5938) in docs/dev/debt/libSceNKWebKit.md, and validated test rigor in core/libs/prx/libSceNKWebKit/tests/CrossOriginRequest.cpp. - Minor: please drop the `Generated with` footer from the description; the AI-assisted checkbox can stay. Requesting changes for the points above.
PrivacyOnion commented 2026-11-13 18:23:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-13T18:23:39Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 5410e58045:

  • Conventions: tools/check_conventions.py passed; git diff --check reported whitespace errors.
  • Build: nkwebkit_crossoriginrequest_tests built cleanly.
  • CTest (nkwebkit_crossoriginrequest):
    1/1 Test #3876: nkwebkit_crossoriginrequest ......   Passed    0.03 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified _ZN7WebCore32isSimpleCrossOriginAccessRequestERKN3WTF6StringERKNS_13HTTPHeaderMapE in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: method validation enforces exact case-sensitive matching for 'GET', 'HEAD', and 'POST', correctly returning false on empty, null, or alternative methods.
    • Verified header validation rules in IsSafeHeader in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: strictly enforces the 128-code-unit length limit, checks CORS-unsafe bytes on 'Accept', permits only alphanumeric characters and allowed punctuation ( *,-.;=) on 'Accept-Language' and 'Content-Language', and validates MIME type and sniffing rules on 'Content-Type'.
    • Verified range parsing in IsSafeRange and ParseInteger in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: correctly disallows spaces and tabs, handles 'bytes=' prefixing and HTTP space trimming, enforces single-range syntax, and performs exact overflow-checked 64-bit integer parsing against LLONG_MAX and LLONG_MIN.
    • Verified memory safety and error handling in CodeUnits and map iteration: safely handles null WTF::String pointers, validates value.impl->data when length is non-zero, throws std::invalid_argument on null buffer storage with non-zero size or out-of-range HTTPHeaderName enum indices, and correctly supports both 8-bit and UTF-16 character encodings.
    • Verified repository rules and technical debt tracking in docs/dev/debt/libSceNKWebKit.md, Export.cpp, and InventoryExports.hpp: stub removed cleanly from inventory, export signature placed in CrossOriginRequestExports.hpp, technical debt properly documented, and verbatim license notices accepted by maintainer in PR discussion.
    • Verified test coverage in core/libs/prx/libSceNKWebKit/tests/CrossOriginRequest.cpp: thoroughly exercises 1,383 assertions covering method variants, all safelisted and unlisted headers, unsafe character byte tables, boundary lengths (128 vs 129), range endpoints, and exception throwing on corrupted storage.
  • Minor: please drop the Generated with footer from the description; the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5896033135 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18805#pullrequestreview-5896033135). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-13T18:23:39Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `5410e58045`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` reported whitespace errors. - **Build**: `nkwebkit_crossoriginrequest_tests` built cleanly. - **CTest** (`nkwebkit_crossoriginrequest`): ``` 1/1 Test #3876: nkwebkit_crossoriginrequest ...... Passed 0.03 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceNKWebKit/Export.cpp`, `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`, `core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified `_ZN7WebCore32isSimpleCrossOriginAccessRequestERKN3WTF6StringERKNS_13HTTPHeaderMapE` in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: method validation enforces exact case-sensitive matching for 'GET', 'HEAD', and 'POST', correctly returning false on empty, null, or alternative methods. - Verified header validation rules in `IsSafeHeader` in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: strictly enforces the 128-code-unit length limit, checks CORS-unsafe bytes on 'Accept', permits only alphanumeric characters and allowed punctuation (` *,-.;=`) on 'Accept-Language' and 'Content-Language', and validates MIME type and sniffing rules on 'Content-Type'. - Verified range parsing in `IsSafeRange` and `ParseInteger` in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp: correctly disallows spaces and tabs, handles 'bytes=' prefixing and HTTP space trimming, enforces single-range syntax, and performs exact overflow-checked 64-bit integer parsing against `LLONG_MAX` and `LLONG_MIN`. - Verified memory safety and error handling in `CodeUnits` and map iteration: safely handles null `WTF::String` pointers, validates `value.impl->data` when length is non-zero, throws `std::invalid_argument` on null buffer storage with non-zero size or out-of-range `HTTPHeaderName` enum indices, and correctly supports both 8-bit and UTF-16 character encodings. - Verified repository rules and technical debt tracking in docs/dev/debt/libSceNKWebKit.md, Export.cpp, and InventoryExports.hpp: stub removed cleanly from inventory, export signature placed in CrossOriginRequestExports.hpp, technical debt properly documented, and verbatim license notices accepted by maintainer in PR discussion. - Verified test coverage in core/libs/prx/libSceNKWebKit/tests/CrossOriginRequest.cpp: thoroughly exercises 1,383 assertions covering method variants, all safelisted and unlisted headers, unsafe character byte tables, boundary lengths (128 vs 129), range endpoints, and exception throwing on corrupted storage. - Minor: please drop the `Generated with` footer from the description; the AI-assisted checkbox can stay. Requesting changes for the points above.
PrivacyOnion commented 2026-11-15 21:07:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T21:07:37Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 5410e58045:

  • Conventions: tools/check_conventions.py passed; git diff --check reported whitespace errors.
  • Build: nkwebkit_crossoriginrequest_tests built cleanly.
  • CTest (nkwebkit_crossoriginrequest):
    1/1 Test #4200: nkwebkit_crossoriginrequest ......   Passed    0.03 sec
    100% tests passed, 0 tests failed out of 1
    

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5912938776 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18805#pullrequestreview-5912938776). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-15T21:07:37Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `5410e58045`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` reported whitespace errors. - **Build**: `nkwebkit_crossoriginrequest_tests` built cleanly. - **CTest** (`nkwebkit_crossoriginrequest`): ``` 1/1 Test #4200: nkwebkit_crossoriginrequest ...... Passed 0.03 sec 100% tests passed, 0 tests failed out of 1 ``` Requesting changes for the points above.
PrivacyOnion commented 2026-11-16 10:58:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-16T10:58:12Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against b6656020c1:

  • Conventions: tools/check_conventions.py passed; git diff --check reported whitespace errors.
  • Build: nkwebkit_crossoriginrequest_tests built cleanly.
  • CTest (nkwebkit_crossoriginrequest):
    1/1 Test #4303: nkwebkit_crossoriginrequest ......   Passed    0.03 sec
    100% tests passed, 0 tests failed out of 1
    

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5918858715 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18805#pullrequestreview-5918858715). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-16T10:58:12Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `b6656020c1`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` reported whitespace errors. - **Build**: `nkwebkit_crossoriginrequest_tests` built cleanly. - **CTest** (`nkwebkit_crossoriginrequest`): ``` 1/1 Test #4303: nkwebkit_crossoriginrequest ...... Passed 0.03 sec 100% tests passed, 0 tests failed out of 1 ``` Requesting changes for the points above.
PrivacyOnion commented 2026-11-16 19:40:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-16T19:40:32Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against b6656020c1:

  • Conventions: tools/check_conventions.py passed.
  • Build: nkwebkit_crossoriginrequest_tests built cleanly.
  • CTest (nkwebkit_crossoriginrequest):
    1/1 Test #4316: nkwebkit_crossoriginrequest ......   Passed    0.02 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified method validation in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:258-259 strictly accepts case-sensitive 'GET', 'HEAD', and 'POST' via CodeUnits(), handling both 8-bit (hashAndFlags & 4) and 16-bit WTF::StringImpl representations and throwing std::invalid_argument on null character storage with non-zero length.
    • Verified HTTPHeaderMap validation in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:260-271 checks common.buffer and uncommon.buffer for nullptr when size > 0, validates HTTPHeaderName enum bounds against NKWebKit::HttpAbi::headerNames.size(), and rejects any uncommon header entries.
    • Verified per-header rules in IsSafeHeader (core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:222-252): enforces the 128-code-unit limit, filters CORS-unsafe bytes in Accept and Content-Type, restricts Accept-Language and Content-Language to ASCII alphanumerics and ' *,-.;=', and validates Content-Type via WebCore::isValidContentType(..., MimeSniff) and case-insensitive essence matching.
    • Verified Range header parsing in IsSafeRange and ParseInteger (core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:178-220) matches pinned PS5 WebKit 80f77e94 HTTPParsers.cpp behavior, including rejecting spaces/tabs, stripping HTTP whitespace around 'bytes' and the range value, overflow-safe signed 64-bit integer parsing, and signed endpoint comparison.
    • Verified unit tests in core/libs/prx/libSceNKWebKit/tests/CrossOriginRequest.cpp:54-196 cover both 8-bit and 16-bit strings, all allowed and disallowed methods, header length boundaries (128 vs 129), all 256 byte values for unsafe characters, signed 64-bit integer limits in Range, uncommon headers, and null storage exception paths.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5926328566 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18805#pullrequestreview-5926328566). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-16T19:40:32Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `b6656020c1`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `nkwebkit_crossoriginrequest_tests` built cleanly. - **CTest** (`nkwebkit_crossoriginrequest`): ``` 1/1 Test #4316: nkwebkit_crossoriginrequest ...... Passed 0.02 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceNKWebKit/Export.cpp`, `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`, `core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified method validation in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:258-259 strictly accepts case-sensitive 'GET', 'HEAD', and 'POST' via CodeUnits(), handling both 8-bit (hashAndFlags & 4) and 16-bit WTF::StringImpl representations and throwing std::invalid_argument on null character storage with non-zero length. - Verified HTTPHeaderMap validation in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:260-271 checks common.buffer and uncommon.buffer for nullptr when size > 0, validates HTTPHeaderName enum bounds against NKWebKit::HttpAbi::headerNames.size(), and rejects any uncommon header entries. - Verified per-header rules in IsSafeHeader (core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:222-252): enforces the 128-code-unit limit, filters CORS-unsafe bytes in Accept and Content-Type, restricts Accept-Language and Content-Language to ASCII alphanumerics and ' *,-.;=', and validates Content-Type via WebCore::isValidContentType(..., MimeSniff) and case-insensitive essence matching. - Verified Range header parsing in IsSafeRange and ParseInteger (core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:178-220) matches pinned PS5 WebKit 80f77e94 HTTPParsers.cpp behavior, including rejecting spaces/tabs, stripping HTTP whitespace around 'bytes' and the range value, overflow-safe signed 64-bit integer parsing, and signed endpoint comparison. - Verified unit tests in core/libs/prx/libSceNKWebKit/tests/CrossOriginRequest.cpp:54-196 cover both 8-bit and 16-bit strings, all allowed and disallowed methods, header length boundaries (128 vs 129), all 256 byte values for unsafe characters, signed 64-bit integer limits in Range, uncommon headers, and null storage exception paths. Looks Good To Me
PrivacyOnion commented 2026-11-17 21:58:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-17T21:58:37Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 8d8cba4b75:

  • Conventions: tools/check_conventions.py passed.
  • Build: nkwebkit_crossoriginrequest_tests built cleanly.
  • CTest (nkwebkit_crossoriginrequest):
    1/1 Test #4465: nkwebkit_crossoriginrequest ......   Passed    0.02 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp, core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified method checking in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:258-259 strictly allows case-sensitive 'GET', 'HEAD', and 'POST' and decodes WTF::StringImpl 8-bit and 16-bit storage via CodeUnits()
    • Verified HTTPHeaderMap bounds and pointer checks in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:260-271 validating buffer non-null when size > 0 and rejecting uncommon headers
    • Verified IsSafeHeader and IsSafeRange in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:178-252 against pinned PS5 WebKit 80f77e94 HTTPParsers.cpp and CrossOriginAccessControl.cpp specifications, including 128-code-unit limit and CORS-unsafe byte validation
    • Verified 64-bit integer parsing and signed bounds checking in ParseInteger/IsSafeRange in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:158-220 avoiding integer overflow and conforming to upstream range behavior
    • Verified test coverage in core/libs/prx/libSceNKWebKit/tests/CrossOriginRequest.cpp:54-196 testing both wide and narrow strings, all 256 byte characters, valid and invalid ranges, and invalid storage exceptions

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5947299852 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18805#pullrequestreview-5947299852). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-17T21:58:37Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `8d8cba4b75`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `nkwebkit_crossoriginrequest_tests` built cleanly. - **CTest** (`nkwebkit_crossoriginrequest`): ``` 1/1 Test #4465: nkwebkit_crossoriginrequest ...... Passed 0.02 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceNKWebKit/Export.cpp`, `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`, `core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp`, `core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified method checking in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:258-259 strictly allows case-sensitive 'GET', 'HEAD', and 'POST' and decodes WTF::StringImpl 8-bit and 16-bit storage via CodeUnits() - Verified HTTPHeaderMap bounds and pointer checks in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:260-271 validating buffer non-null when size > 0 and rejecting uncommon headers - Verified IsSafeHeader and IsSafeRange in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:178-252 against pinned PS5 WebKit 80f77e94 HTTPParsers.cpp and CrossOriginAccessControl.cpp specifications, including 128-code-unit limit and CORS-unsafe byte validation - Verified 64-bit integer parsing and signed bounds checking in ParseInteger/IsSafeRange in core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:158-220 avoiding integer overflow and conforming to upstream range behavior - Verified test coverage in core/libs/prx/libSceNKWebKit/tests/CrossOriginRequest.cpp:54-196 testing both wide and narrow strings, all 256 byte characters, valid and invalid ranges, and invalid storage exceptions Looks Good To Me
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!18805
No description provided.