fix(libSceNKWebKit): validate guest pointers in CrossOriginRequest exports #27943
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27943"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-11-27T21:40:09Z.
What
Validate guest pointers in
WebCore::isSimpleCrossOriginAccessRequest,WebCore::cleanHTTPRequestHeadersForAccessControl, andWebCore::updateRequestForAccessControlincore/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cpp:method,HTTPHeaderMapheaders,commonvector entries, and nestedStringImplcharacter buffers throughGuestCopyIn_nid_no_patchinisSimpleCrossOriginAccessRequest, passing host-owned string copies toisValidContentTypewhile preservingstd::invalid_argumentfor null character/vector storage and invalid header names.ResourceRequestBasestorage,commonheader vector storage, and releasableStringImplheaders (matchingWtfAbi::ReleaseSharedSubstringtag2and terminating-flag checks) underGuestArena::HostWritebefore mutating request headers or bitfields viaGuestCopyIn_nid_no_patch/GuestCopyOut_nid_no_patch.SecurityOriginand its nested strings into a host-owned copy before invokingSecurityOrigin::toStringinupdateRequestForAccessControl, and validaterequest->url.implbeforeremoveCredentials.docs/dev/debt/changes/fix-libSceNKWebKit-cross-origin-request-guest-pointers.mdand add guarded-page / read-only / split-page / nested-storage regression coverage incore/libs/prx/libSceNKWebKit/tests/CrossOriginRequestGuestPointers.cpp.Tested
/mnt/sas-ssd/AnyPS5-work/agy/build-spec):CrossOriginRequestGuestPointers.cppagainstorigin/mainCrossOriginRequest.cpp):ctest --test-dir build-spec -R '^nkwebkit_crossoriginrequestguestpointers$' --output-on-failure-> failed withSEGFAULT.00cbe94ebe4):ctest --test-dir build-spec -R '^(nkwebkit_crossoriginrequestguestpointers|nkwebkit_crossoriginrequest|nkwebkit_crossoriginaccessrequest)$' --output-on-failure-> 3/3 passed.python3 tools/guest_pointer_audit.py libSceNKWebKit: 0 hits inCrossOriginRequest.cpp.python3 tools/check_conventions.py --base origin/main: All conventions checks passed.python3 tools/pr_overlap.py --branch fix/libSceNKWebKit-cross-origin-request-guest-pointers: No overlap with open pull requests.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T21:48:18Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change based on the code reviewed; the reported Linux test results were not run independently in this session.
What I ran
Reviewed head
00cbe94ebe46b7d2e6be38bc6484836b7ad0fe04. I read the prepared description, commits, manifest, diff, and all three changed files, plus targetedResourceRequest,HttpHeaderMap,WtfString, and guest-memory helpers at the pinned head. The repository reader was unavailable as a shell command here, so I could not run tests or inspect CI output.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
The reviewed change is CrossOriginRequest.cpp at the pinned head, with regression coverage in CrossOriginRequestGuestPointers.cpp and the console behavior limitation recorded in the debt note.
Not verified
I did not run the reported CTest, guest-pointer audit, conventions check, or PR overlap check. The author reports 3/3 Linux x86_64 Release tests passed and the listed audits completed. Console fault behavior was not verified. All files marked
changedin the manifest were read; no changed files were excluded by the bundle.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-27T21:51:35Z.
Review: COMMENTED
Actionable comments posted: 8
f1eb389e-9c1e-45ed-93a6-d05352a16809Reviewing files that changed from the base of the PR and between
5466a07b07and00cbe94ebe.core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cppcore/libs/prx/libSceNKWebKit/tests/CrossOriginRequestGuestPointers.cppdocs/dev/debt/changes/fix-libSceNKWebKit-cross-origin-request-guest-pointers.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-27T21:52:16Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
00cbe94ebe:tools/check_conventions.pypassed.nkwebkit_crossoriginrequestguestpointers_testsbuilt cleanly.nkwebkit_crossoriginrequestguestpointers):core/libs/prx/libSceNKWebKit/src/CrossOriginRequest.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-11-28T05:39:38Z.
Review: APPROVED
Checked head
00cbe94ebe. All on Windows 11 with WinLibs GCC 15.2 (Release), applied tomain4c7578e0a4together with #27997, #27996, #27978, #27975, #27973, #27971, #27969, #27967, #27964, #27958, #27950, #27949, #27946, #27945, #27938, #27936.tools/check_conventions.py --headandtools/debt_fold.py --checkpassed and the full build succeeded.nkwebkit_crossoriginrequestguestpointerspasses. In the full CPU suite (5,131 tests) the only failures are unrelated:windows_read_trap_unknownfails onmaintoo (fixed in #28028), andframe_capture_minimizeis a timeout under load that passes on its own.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T08:12:54Z.
Review: COMMENTED
The cross-origin request fixture checked that rejected origin objects and a rejected credentials value leave the request flags unchanged. It also checked the writable prefix of a split request for unintended writes.
I ran the exact fixture and changed translation unit in a focused Linux build linked against the project’s guest libraries.
AI-assisted: yes.