Archive decompression lacks output-size limits, allowing disk exhaustion via highly compressed archives
Please make sure of the following things
-
[x] I have read the documentation. 我已经阅读了文档。
-
[x] I'm sure there are no duplicate issues or discussions. 我确定没有重复的issue或讨论。
-
[x] I'm sure it's due to
AListand not something else(such as Network ,DependenciesorOperational). 我确定是AList的问题,而不是其他原因(例如网络,依赖或操作)。 -
[x] I'm sure this issue is not fixed in the latest version. 我确定这个问题在最新版本中没有被修复。
AList Version / AList 版本
v3.61.0
Driver used / 使用的存储驱动
Local storage driver (Docker bind-mounted local filesystem)
Describe the bug / 问题描述
Summary
AList does not enforce output-size limits when extracting archives. A user with archive decompression permission and write access to a storage path can submit a highly compressed archive that expands to a disproportionately large amount of data.
This may exhaust the available disk space, prevent AList from performing further write operations, and affect other services sharing the same filesystem.
This issue is related to CWE-400 (Uncontrolled Resource Consumption) and CWE-409 (Improper Handling of Highly Compressed Data).
Affected Versions
- Runtime reproduction confirmed on AList v3.61.0.
- Source review indicates that v3.62.0 still contains the same unbounded decompression code path.
- Runtime reproduction has not yet been repeated on v3.62.0.
Required Permissions
Triggering this issue requires:
- An authenticated user or role with
PermDecompress. - Write access to the source and destination storage paths.
- A writable storage driver.
Therefore, the overall severity depends on how broadly archive decompression permission is granted in a particular deployment.
Root Cause
In internal/archive/tool/helper.go, the _decompress function copies the decompressed stream directly to the destination file:
_, err = io.Copy(f, &stream.ReaderUpdatingProgress{
Reader: &stream.SimpleReaderWithSize{
Reader: rc,
Size: file.FileInfo().Size(),
},
UpdateProgress: up,
})
This operation does not enforce:
- A maximum decompressed size per file.
- A maximum cumulative output size per extraction task.
- A maximum compression ratio.
- A maximum number of archive entries.
The request handler checks path and role permissions, including PermDecompress, but does not impose resource limits before starting the extraction task:
Reproduction Environment
- AList: v3.61.0
- Deployment: Docker
- Storage driver: Local
- Testing scope: An authorized local instance only
Steps to Reproduce
- Create a ZIP archive containing one 50 MiB file filled with repeated zero bytes and compress it using DEFLATE.
- The resulting archive is approximately 49.9 KiB, giving a compression ratio of about 1,029:1.
- Upload the archive to a writable AList storage path.
- Start an archive decompression task through the normal API or user interface.
- Wait for the task to complete.
- Inspect the destination directory.
Actual Result
| Compressed size | Decompressed size | Compression ratio | Result |
|---|---|---|---|
| 51,084 bytes | 52,428,800 bytes | Approximately 1,029:1 | The complete 50 MiB output was written |
AList accepted the request and wrote the complete decompressed file to disk. No size-limit, compression-ratio, quota, or resource-exhaustion error was produced.
Expected Result
AList should reject or terminate an extraction task when a configured resource limit is exceeded.
It should also remove any incomplete output created by a terminated task.
Security Impact
A malicious user with the required permissions could repeatedly extract highly compressed archives and consume storage space while using very little upload bandwidth.
Possible consequences include:
- Exhaustion of the filesystem used by AList.
- Failed uploads, database writes, logging, or other storage operations.
- AList service disruption.
- Disruption of other applications sharing the same filesystem.
For safety, the reproduction was limited to 50 MiB of decompressed output. I did not attempt to exhaust the test system’s disk space.
Suggested Remediation
Consider implementing a combination of the following controls:
- A configurable maximum decompressed size per file.
- A configurable cumulative output limit per extraction task.
- A maximum archive-entry count.
- A configurable compression-ratio threshold where compressed-size metadata is available.
- Cancellation and cleanup of partial output after a limit is exceeded.
- Clear logging and user-facing errors when extraction is rejected.
A task-wide cumulative limit is particularly important because a per-file limit alone would not prevent malicious archives containing a large number of individually acceptable files.
Additional Information
I reproduced this issue only in an isolated and authorized local environment. I can provide the complete reproduction log and a size-limited proof-of-concept archive privately if needed.
I would also be happy to test a proposed patch or repeat the runtime reproduction against v3.62.0.
Reproduction / 复现链接
Reproduced in an isolated local Docker environment. No public reproduction repository is provided because this report describes a potential denial-of-service vulnerability. Complete reproduction steps and sanitized logs are included in the issue body and can be shared privately upon request.
Config / 配置
Logs / 日志
感谢详细的报告,确认解压目前确实没有输出大小限制,会尽快加上解压输出上限的保护。另外这类有安全影响的问题,下次建议走仓库的 Security Advisory 私下提交。
感谢详细的报告,确认解压目前确实没有输出大小限制,会尽快加上解压输出上限的保护。另外这类有安全影响的问题,下次建议走仓库的 Security Advisory 私下提交。
好的,收到建议
@okatu-loli Thanks for the quick fix in #9589. As you suggested, I've filed this through the Security tab as a private report, so there's a draft advisory with the affected/patched versions. If you agree, could you publish it and click "Request CVE", as was done for GHSA-x4q4-7phh-42j9? I noted there that max_extract_size defaults to 0 (unlimited), so users need to set it after upgrading.