fix(libSceHttp): reject malformed escapes and accept port 65536 as a PS5 does #5475
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5475"
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 hugodearaujo on 2026-10-13T20:46:45Z.
What
Two URI functions of libSceHttp disagreed with a PS5 (firmware 13.60). I measured them through the console's
libSceHttp.sprxfrom a payload, and ran the same program against AnyPS5:sceHttpUriUnescapecopied a malformed escape through unchanged and returned 0 (the behaviour the debt entry took from shadPS4). The console returnsERROR_INVALID_URL(0x80433060) for any%that is not followed by two hexadecimal digits, wherever it is in the input, and writes neither the output nor the required size:main%4,%zz,%,abc%,%G1,%-1,% 1,%10x80433060, nothing written%%410x80433060%Aa%41b%,ok%20then%2,%41%0x80433060%4a%4A,%7e%7E,%ff,a%25b,%00xsceHttpUriParserejected port 65536. The console accepts it as port 0, and rejects 65537, 70000, 131072 and larger values. 65535 and00080are accepted on both.The same run found no difference for
sceHttpUriSweepPath(20 paths),sceHttpUriEscape(10 inputs),sceHttpUriMerge(87 base and reference pairs) orsceHttpParseStatusLine(20 lines), so they are unchanged. One difference is left and documented in the debt: when the console rejects a port, it has already written the scheme, user name, password and host to the element and pool; AnyPS5 writes nothing on any failure.Probe output for the changed cases (PS5 13.60)
The last
PARSEline ishttp://host:65537/.30583(0x7777) and~are the probe's untouched fill values.Tested
sceHttpUriUnescape,sceHttpUriParse,sceHttpUriEscape,sceHttpUriMerge,sceHttpUriSweepPath,sceHttpParseStatusLineandsceHttpParseResponseHeaderby NID inlibSceHttp.sprxand runs 178 cases, then 31 more for the edges above. A host build of the same case list against AnyPS5'slibSceHttpgives the comparison.guest_httpnow checks the malformed escapes (error, output and required size untouched) and ports 65535, 65536, 65537 and 70000; it fails with this PR'sUri.cppreverted.agc_driver_tessellationsegfaults the same way onmain.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:26:08Z.
Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.
Pull request closed