Closed hollowaykeanho closed 5 months ago
Communications initated to Hugo main development team. Pending reply.
Hugo dev team acknowledged the submission. Pending response.
Threat reduced to 2 file parsing functions listed above. WASM embed feature is temporarily disabled for the time being. Once hugo fixed the issue, we can launch it as "new feature" in the future.
Description
When developing WASM embed feature function in https://github.com/ZORALab/Hestia/issues/1, it was discovered that Hugo does not offer 'streaming' nature of
readFile
function left alone byte restricted limits. Hence, when reading a large file (e.g. large WASM) beyond RAM capacity, on an OS without swap, it can crash the system entirely. This can be a security (stability) matter when any user tries to develop larger WASM while using hestiaHUGO Hugo theme.Currently, there is no way to workaround this issue. It has to be solved on Hugo side.
Expected Behavior
There is a streaming version of
readFile
that read a default or specifiedN
number of data bytes at a time in arange
loop format.Current Behavior
No such feature available (Confimred in https://discourse.gohugo.io/t/streaming-version-of-readfile-function/40384/3).
Steps to Reproduce (COMPULSORY)
Attachments