Skip to content
Tcl Source Code Artifact [214c60907e]
Login

Artifact [214c60907e]

Artifact 214c60907e2671ebd9ebf14d0cc64f7590276496d666cc9900873c32cca3f78d:

Ticket change [214c60907e] - Ticket [1928131fffffffff|1928131fff] <i>chunked headers leak in data when -handler used</i> status still Open with 7 other changes by kjnash on 2022-05-11 02:20:29.
D 2022-05-11T02:20:29.113
J assignee aku
J closer nobody
J comment Support\sfor\schunk\stransfer\sin\shttp\s2.7\sintroduces\sa\sserious\sincompatibility\swith\srespect\sto\sprevious\shttp\spackage\sversions.\r\n\r\nWhen\sa\s-handler\sargument\sis\sdefined,\schunk\sprocessing\sis\snot\sdone,\sso\sreturned\sdata\shas\s"<size>\\n"\schunk\sheaders\sleaked\sin,\stogether\swith\sa\sterminating\s"0\\n"\ssegment.\sIt\smeans\sany\scurrent\scode\swhich\scalls\sgeturl\swith\sa\s-handler\sargument\s(e.g.\shv3,\sbut\salso\sprobably\smost\scode\scaring\sabout\sreporting\sprogress\sduring\snon-blocking\shttp\stransfer)\swill\sget\scorrupted\sanswer.\sIn\snew\shttp.tcl:1029,\sone\scan\sfind:\r\n\r\nif\s{[info\sexists\sstate(-handler)]}\s{\r\n\sset\sn\s[eval\s$state(-handler)\s[list\s$sock\s$token]]\r\n}\selseif\s{[info\sexists\sstate(transfer_final)]}\s{\r\n\s\s....\r\n}\selseif\s{[info\sexists\sstate(transfer)]\r\n\s\s\s\s\s\s&&\s$state(transfer)\seq\s"chunked"}\s{\r\n\s\s....\r\n\r\nso,\sas\slong\sas\sstate(-handler)\sexists,\schunk\sprocessing\sis\snot\sperformed.\sAlso,\swhile\shaving\sa\slook\sat\sthis\snew\shttp\simplementation,\sI\snoticed\sthat\sin\sthe\schunk\shandling\scode,\ssocket\sis\stemporaly\sswitched\sback\sto\sblocking\smode\swhen\sreading\schunk\slength\sheader\r\n\r\n\s\sfconfigure\s$sock\s-blocking\s1\r\n\s\sset\schunk\s[read\s$sock\s$size]\r\n\s\sfconfigure\s$sock\s-blocking\s$bl\r\n\r\nwhich\sseems\sto\sme\squite\shazardous,\ssince\sthis\smight\sfreeze\sa\swhole\sapplication\sin\sEvent\scallback\sone\smay\sassume\sto\sbe\snon-blocking.
J icomment The\shttp\spackage\s"fixed"\sthis\sbug\syears\sago,\sby\sdropping\sto\sHTTP/1.0\sif\sthe\s-handler\soption\sis\sused.\r\n\r\nThe\s-handler\scallback\sreceives\sthe\sresponse\sas\sthe\sraw\soutput\sfrom\sthe\sserver.\s\sIn\sHTTP/1.1\sthis\sis\snot\suseful\s(we\swould\slike\sinstead\sto\sreceive\sthe\scontent\safter\sde-chunking\sand\sdecompression,\sin\sorder\sto\simplement\sprogressive\srendering).\r\n\r\nThese\sfacts\sare\snoted\sin\sthe\sman\spage\shttp(n),\sso\sI\ssuggest\sclosing\sthis\sbug.
J login kjnash
J mimetype text/plain
J severity Minor
K 1928131fffffffffffffffffffffffffffffffff
U kjnash
Z 08172802c407e4bfeb00a8deed550073