feat(libSceNKWebKit): implement shouldHideReferrer #18804
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18804"
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 AlexWhitehouse on 2026-11-12T10:40:44Z.
What
libSceNKWebKit
WebCore::SecurityPolicy::shouldHideReferrer(const URL&, const String&)(_ZN7WebCore14SecurityPolicy18shouldHideReferrerERKN3WTF3URLERKNS1_6StringE, NIDV8i2vIgKigI) threwnot implemented. This PR ports it from the PS5 WebKit tree the other NKWebKit ports use, 80f77e94:SecurityPolicy.cpplines 59–73: the policy;URL.cpp'sprotocolIsInternal: matching a scheme on the raw referrer string.The new
src/SecurityPolicy.cppstarts with both files' notices.Behaviour:
httporhttpsstring, shown when it ishttp, and, when it ishttps, hidden only if the destination URL isn'thttps.protocolIsInternaldoes::.URL::protocolIsexport.The stub and its inventory row are removed, the NKWebKit count drops from 5970 to 5969, and a debt entry records that the console's ABI is unverified.
Tested
nkwebkit_securitypolicy(core/libs/prx/libSceNKWebKit/tests/SecurityPolicy.cpp) covers:http,https, other-scheme and invalid referrers withhttp,httpsand other destination URLs;main, the test fails with…shouldHideReferrer… not implemented;nkwebkit_securitypolicy,nkwebkit_wtfvalues,guest_nkwebkit_urlsandnkwebkit_wtfpass.nkwebkit_securitypolicy,nkwebkit_wtfandpublic_headerspass at 65e93bd36b, with no compiler warnings in the changed files. The branch was then rebased onto currentmain, where my #17726 had added a debt entry at the same spot; both are kept, and the count line now drops by one, which the original commit had missed. The focused tests pass again on Linux.httpsresult fails withhttps://source/, expected 1 got 0.python3 tools/check_conventions.py --base origin/main: all checks passed.python3 tools/pr_overlap.py: no open PR implements this export. I compared the 72 NKWebKit PRs it lists: none changes this export, its NID or the new files, and #18357's implementation hunks aren't touched. My other NKWebKit PRs share the count line. Whichever merges second recounts.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-12T10:53:22Z.
Review: CHANGES_REQUESTED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
07e0e25fa4:tools/check_conventions.pypassed;git diff --checkreported whitespace errors.nkwebkit_securitypolicy_testsbuilt cleanly.nkwebkit_securitypolicy):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.urlparameter. When a caller passesurl = nullptrwith an HTTPS referrer (e.g.referrer = \"https://source/\"),referreris non-null so line 86 passes, andreferrerIsSecureURLevaluates totrue. Execution bypasses the early returns on lines 89 and 90 and reaches line 92 (bool urlIsSecureURL = _ZNK3WTF3URL10protocolIsENS_10StringViewE(url, {\"https\", 5, true});), which passesnullptras thethispointer toWTF::URL::protocolIs, resulting in an unchecked null pointer dereference and segmentation fault instead of throwingstd::invalid_argumentas specified indocs/dev/debt/libSceNKWebKit.md("Null accessed references or character buffers throw where upstream dereferences them").Generated withfooter from the description; the AI-assisted checkbox can stay.Requesting changes for the points above.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-12T11:34:40Z.
Review: CHANGES_REQUESTED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
258aa99d8a:tools/check_conventions.pypassed;git diff --checkreported whitespace errors.nkwebkit_securitypolicy_testsbuilt cleanly.nkwebkit_securitypolicy):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Generated withfooter from the description; the AI-assisted checkbox can stay.Requesting changes for the points above.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-12T14:14:37Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
71b9e7d0b6:tools/check_conventions.pypassed;git diff --checkclean.nkwebkit_securitypolicy_testsbuilt cleanly.nkwebkit_securitypolicy):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Generated withfooter from the description; the AI-assisted checkbox can stay.Looks Good To Me