Skip to content
Tcl Source Code Artifact [6c76db6c7a]
Login

Artifact [6c76db6c7a]

Artifact 6c76db6c7aa83811399ffb7f126f5d99381cd57183b050a5805e4cabdfb27047:

Ticket change [6c76db6c7a] - Ticket [9563b8eeeca59ca8|9563b8eeec] <i>Possible zlib compression bomb vulnerabilities</i> status still Open with 3 other changes by dkf on 2026-06-24 15:56:56.
D 2026-06-24T15:56:56.646
J icomment After\sthinking\sabout\sthis\smore,\sI'm\sgoing\sto\sbe\susing\sthis\ssort\sof\sthing\sas\sa\stest\scase\srather\sthan\sas\san\sarbitrary\sguard\srail.\r\n\r\nCode\sthat\sreads\sfrom\sreally\suntrusted\ssources\sneeds\sto\sbound\sthe\samount\sthat\sit\sactually\sreads.\sCompression\salgorithms\sdon't\schange\sthat\sat\sall\s(after\sall,\schecking\sthe\sfile\ssize\sahead\sof\stime\sleaves\sTOCTOU\svulnerabilities).\sTcl\sdoesn't\simpose\sa\spolicy\slimit\son\show\smuch\sis\saccepted\s(as\sit\sdepends\son\sthe\sapplication)\sbut\sdoes\sgive\sthe\stools\sto\slet\suser\scode\sdecide\sthat.\r\n\r\nWe\s_may_\schoose\sto\sprovide\sa\sway\sto\slet\s`zlib\sinflate`\s(and\s`zlib\sdecompress`\sand\s`zlib\sgunzip`,\swhich\sare\sreally\sthe\ssame\sthing\sin\sthis\srespect)\simpose\sa\slimit\son\sthe\samount\sof\sdata\sproduced,\sbut\s_both\sthe\sstream\sand\schannel\sAPIs\salready\shave\ssuch\scapabilities\savailable_\s(and\sstreams\salways\sstore\scompressed\sdata)\sin\sthat\sthey\sallow\staking\sfixed/bounded-size\spieces\sof\sthe\sdata,\sand\sthe\suser\scan\sdecide\show\smany\sto\stake\sbefore\srejecting.\sThe\stools\sfor\smitigating\sthis\ssort\sof\sthing\sexist,\sand\shave\sexisted\sall\salong\ssince\sthe\sinception\sof\sthe\smodern\s`zlib`\scommand\sin\s8.6.\r\n\r\nTcl\s_does\snot_\sprevent\susers\sfrom\swriting\ssomething\ssilly\sif\sthey\swant.\sAdding\sarbitrary\srestrictions,\ssuch\sas\son\show\smuch\sdata\scan\sbe\scompressed\sor\swhat\scompression\sratio\smay\sbe\sused,\sprevents\sother\sconforming\sapplications\sfrom\sdoing\swhat\sthey\swant.\sHigh\smemory\sconsumption\s_may_\sbe\sa\sproblem\sin\ssome\scases,\sbut\sit's\snot\sin\sall\sand\swe\sshouldn't\sfussily\sprevent\sit.
J login dkf
J mimetype text/x-markdown
K 9563b8eeeca59ca891df8406c80ae71ae6a73b57
U dkf
Z 9b7b1ad9d87ee59a527299b49034d440