---
id: "CVE-2024-32874"
kind: "vulnerability"
aliases: ["CVE-2024-32874", "GHSA-w4h6-9wrp-v5jq"]
title: "Malicious Long Unicode filenames may cause a Multiple Application-level Denial of Service"
severity: "critical"
cvss: 9.3
epss: 0.00774
exploited: false
status: "open"
category: "package"
products: [{"name": "frigate", "fixed": ["0.13.2"], "affected": "< 0.13.2", "ecosystem": "pypi"}]
ecosystems: ["pypi"]
tags: ["cwe-770", "flask", "frigate", "package", "python", "self-hosted"]
not_affected_if: ["auth-required", "frigate-0.13.2-or-later"]
published_at: "2024-05-09T15:13:49+00:00"
first_seen_at: "2026-10-27T16:41:05+00:00"
updated_at: "2026-10-27T16:42:06+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-w4h6-9wrp-v5jq", "first_seen_at": "2026-10-27T16:41:05+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-32874", "first_seen_at": "2026-10-27T17:03:04+00:00"}]
---

# Malicious Long Unicode filenames may cause a Multiple Application-level Denial of Service

Frigate passes user-supplied filenames to Werkzeug's secure_filename(), which runs costly Unicode NFKD normalization with no length limit. A very long Unicode filename makes the server spend heavy CPU, causing application-level denial of service.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:frigate affected < 0.13.2 fixed 0.13.2

## How to check

- Check the installed Frigate version against the affected range below `< 0.13.2`
- Run `pip show frigate` or inspect the container image tag to confirm the version
- Confirm whether Frigate is reachable without an authenticating reverse proxy in front of it

## Fix

- Upgrade Frigate to `0.13.2` or later
- Keep Frigate behind authentication and do not expose it publicly without it

## Timeline

- 2026-10-27T16:41:05+00:00 ghsa https://github.com/advisories/GHSA-w4h6-9wrp-v5jq
- 2026-10-27T17:03:04+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2024-32874

## From the sources

**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'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](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('℀' * 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

<details>
<summary>Path with 2 steps</summary>

1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L379C20-L379C31)
   <pre><code class="python">@MediaBp.route("/&lt;camera_name&gt;/start/&lt;int:start_ts&gt;/end/&lt;int:end_ts&gt;/clip.mp4")
   @MediaBp.route("/&lt;camera_name&gt;/start/&lt;float:start_ts&gt;/end/&lt;float:end_ts&gt;/clip.mp4")
   def recording_clip(<strong>camera_name</strong>, start_ts, end_ts):
       download = request.args.get("download", type=bool)

   </code></pre>

2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L408C33-L408C78)
   <pre><code class="python">            playlist_lines.append(f"outpoint {int(end_ts - clip.start_time)}")

       file_name = secure_filename(<strong>f"clip_{camera_name}_{start_ts}-{end_ts}.mp4"</strong>)
       path = os.path.join(CACHE_DIR, file_name)

   </code></pre>

</details>

----------------------------------------

[frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L408C33-L408C78)

<pre><code class="python">            playlist_lines.append(f"outpoint {int(end_ts - clip.start_time)}")

    file_name = secure_filename(<strong>f"clip_{camera_name}_{start_ts}-{end_ts}.mp4"</strong>)
    path = os.path.join(CACHE_DIR, file_name)

</code></pre>

*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).*

#### Paths

<details>
<summary>Path with 2 steps</summary>

1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L379C33-L379C41)
   <pre><code class="python">@MediaBp.route("/&lt;camera_name&gt;/start/&lt;int:start_ts&gt;/end/&lt;int:end_ts&gt;/clip.mp4")
   @MediaBp.route("/&lt;camera_name&gt;/start/&lt;float:start_ts&gt;/end/&lt;float:end_ts&gt;/clip.mp4")
   def recording_clip(camera_name, <strong>start_ts</strong>, end_ts):
       download = request.args.get("download", type=bool)

   </code></pre>

2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L408C33-L408C78)
   <pre><code class="python">            playlist_lines.append(f"outpoint {int(end_ts - clip.start_time)}")

       file_name = secure_filename(<strong>f"clip_{camera_name}_{start_ts}-{end_ts}.mp4"</strong>)
       path = os.path.join(CACHE_DIR, file_name)

   </code></pre>

</details>

----------------------------------------

[frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L408C33-L408C78)

<pre><code class="python">            playlist_lines.append(f"outpoint {int(end_ts - clip.start_time)}")

    file_name = secure_filename(<strong>f"clip_{camera_name}_{start_ts}-{end_ts}.mp4"</strong>)
    path = os.path.join(CACHE_DIR, file_name)

</code></pre>

*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).*

#### Paths

<details>
<summary>Path with 2 steps</summary>

1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L379C43-L379C49)
   <pre><code class="python">@MediaBp.route("/&lt;camera_name&gt;/start/&lt;int:start_ts&gt;/end/&lt;int:end_ts&gt;/clip.mp4")
   @MediaBp.route("/&lt;camera_name&gt;/start/&lt;float:start_ts&gt;/end/&lt;float:end_ts&gt;/clip.mp4")
   def recording_clip(camera_name, start_ts, <strong>end_ts</strong>):
       download = request.args.get("download", type=bool)

   </code></pre>

2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L408C33-L408C78)
   <pre><code class="python">            playlist_lines.append(f"outpoint {int(end_ts - clip.start_time)}")

       file_name = secure_filename(<strong>f"clip_{camera_name}_{start_ts}-{end_ts}.mp4"</strong>)
       path = os.path.join(CACHE_DIR, file_name)

   </code></pre>

</details>

----------------------------------------

[frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L646C25-L646C47)

<pre><code class="python">        current_app.frigate_config,
        camera_name,
        secure_filename(<strong>name.replace(" ", "_")</strong>) if name else None,
        int(start_time),
        int(end_time),
</code></pre>

*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).*

#### Paths

<details>
<summary>Path with 8 steps</summary>

1. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L23C5-L23C12)
   <pre><code class="python">    jsonify,
       make_response,
       <strong>request</strong>,
   )
   from peewee import DoesNotExist, fn
   </code></pre>

2. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L23C5-L23C12)
   <pre><code class="python">    jsonify,
       make_response,
       <strong>request</strong>,
   )
   from peewee import DoesNotExist, fn
   </code></pre>

3. [frigate/api/media.py](https://github.com/blakeblackshear/frigate/blob/d7ae0eedf89e14f297093ac5c8042862034cbaeb/frigate/api/media.py#L620C28-L620C35)
   <pre><code class="python">        )

       json: dict[str, any] = <strong>request</strong>.get_json(silent=True) or {}
       playback_factor = json.get("playback", "realtime")
       name: Optional[str] = json.get("name")
   </code></pre>

4. [frigate/api/media.py](https://github.com/blakeblackshe

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
