New MCP server — Bring vulnerability intelligence into your AI
Back to feed

CVE-2024-32874

NVDCIRCLENISA

EUVD-2024-1822 · Published May 9, 2024

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

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 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
    <pre><code class="python">@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(<strong>camera_name</strong>, start_ts, end_ts):
    download = request.args.get("download", type=bool)

    </code></pre>

  2. frigate/api/media.py
    <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

<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 can reach a costly Unicode normalization operation.

Paths

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

  1. frigate/api/media.py
    <pre><code class="python">@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, <strong>start_ts</strong>, end_ts):
    download = request.args.get("download", type=bool)

    </code></pre>

  2. frigate/api/media.py
    <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

<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 can reach a costly Unicode normalization operation.

Paths

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

  1. frigate/api/media.py
    <pre><code class="python">@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, <strong>end_ts</strong>):
    download = request.args.get("download", type=bool)

    </code></pre>

  2. frigate/api/media.py
    <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

<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 can reach a costly Unicode normalization operation.

Paths

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

  1. frigate/api/media.py
    <pre><code class="python"> jsonify,
    make_response,
    <strong>request</strong>,
    )
    from peewee import DoesNotExist, fn
    </code></pre>

  2. frigate/api/media.py
    <pre><code class="python"> jsonify,
    make_response,
    <strong>request</strong>,
    )
    from peewee import DoesNotExist, fn
    </code></pre>

  3. frigate/api/media.py
    <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
    <pre><code class="python"> )

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

    </code></pre>

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

    recordings_count = (
    

    </code></pre>

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

    recordings_count = (
    

    </code></pre>

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

    recordings_count = (
    

    </code></pre>

  8. frigate/api/media.py
    <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>

</details>


frigate/api/media.py

<pre><code class="python">def export_rename(file_name_current, file_name_new: str):
safe_file_name_current = secure_filename(
<strong>export_filename_check_extension(file_name_current)</strong>
)
file_current = os.path.join(EXPORT_DIR, safe_file_name_current)
</code></pre>

This user-provided value can reach a costly Unicode normalization operation.

Paths

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

  1. frigate/api/media.py
    <pre><code class="python">
    @MediaBp.route("/export/<file_name_current>/<file_name_new>", methods=["PATCH"])
    def export_rename(<strong>file_name_current</strong>, file_name_new: str):
    safe_file_name_current = secure_filename(
    export_filename_check_extension(file_name_current)
    </code></pre>

  2. frigate/api/media.py
    <pre><code class="python">def export_rename(file_name_current, file_name_new: str):
    safe_file_name_current = secure_filename(
    export_filename_check_extension(<strong>file_name_current</strong>)
    )
    file_current = os.path.join(EXPORT_DIR, safe_file_name_current)
    </code></pre>

  3. frigate/api/media.py
    <pre><code class="python">

    def export_filename_check_extension(<strong>filename</strong>: str):
    if filename.endswith(".mp4"):
    return filename
    </code></pre>

  4. frigate/api/media.py
    <pre><code class="python">def export_filename_check_extension(filename: str):
    if filename.endswith(".mp4"):
    return <strong>filename</strong>
    else:
    return filename + ".mp4"
    </code></pre>

  5. frigate/api/media.py
    <pre><code class="python">def export_rename(file_name_current, file_name_new: str):
    safe_file_name_current = secure_filename(
    <strong>export_filename_check_extension(file_name_current)</strong>
    )
    file_current = os.path.join(EXPORT_DIR, safe_file_name_current)
    </code></pre>

</details>

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

  1. frigate/api/media.py
    <pre><code class="python">
    @MediaBp.route("/export/<file_name_current>/<file_name_new>", methods=["PATCH"])
    def export_rename(<strong>file_name_current</strong>, file_name_new: str):
    safe_file_name_current = secure_filename(
    export_filename_check_extension(file_name_current)
    </code></pre>

  2. frigate/api/media.py
    <pre><code class="python">def export_rename(file_name_current, file_name_new: str):
    safe_file_name_current = secure_filename(
    export_filename_check_extension(<strong>file_name_current</strong>)
    )
    file_current = os.path.join(EXPORT_DIR, safe_file_name_current)
    </code></pre>

  3. frigate/api/media.py
    <pre><code class="python">

    def export_filename_check_extension(<strong>filename</strong>: str):
    if filename.endswith(".mp4"):
    return filename
    </code></pre>

  4. frigate/api/media.py
    <pre><code class="python"> return filename
    else:
    return <strong>filename + ".mp4"</strong>

    </code></pre>

  5. frigate/api/media.py
    <pre><code class="python">def export_rename(file_name_current, file_name_new: str):
    safe_file_name_current = secure_filename(
    <strong>export_filename_check_extension(file_name_current)</strong>
    )
    file_current = os.path.join(EXPORT_DIR, safe_file_name_current)
    </code></pre>

</details>


frigate/api/media.py

<pre><code class="python"> )

safe_file_name_new = secure_filename(<strong>export_filename_check_extension(file_name_new)</strong>)
file_new = os.path.join(EXPORT_DIR, safe_file_name_new)

</code></pre>

This user-provided value can reach a costly Unicode normalization operation.

Paths

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

  1. frigate/api/media.py
    <pre><code class="python">
    @MediaBp.route("/export/<file_name_current>/<file_name_new>", methods=["PATCH"])
    def export_rename(file_name_current, <strong>file_name_new</strong>: str):
    safe_file_name_current = secure_filename(
    export_filename_check_extension(file_name_current)
    </code></pre>

  2. frigate/api/media.py
    <pre><code class="python"> )

    safe_file_name_new = secure_filename(export_filename_check_extension(<strong>file_name_new</strong>))
    file_new = os.path.join(EXPORT_DIR, safe_file_name_new)
    

    </code></pre>

  3. frigate/api/media.py
    <pre><code class="python">

    def export_filename_check_extension(<strong>filename</strong>: str):
    if filename.endswith(".mp4"):
    return filename
    </code></pre>

  4. frigate/api/media.py
    <pre><code class="python">def export_filename_check_extension(filename: str):
    if filename.endswith(".mp4"):
    return <strong>filename</strong>
    else:
    return filename + ".mp4"
    </code></pre>

  5. frigate/api/media.py
    <pre><code class="python"> )

    safe_file_name_new = secure_filename(<strong>export_filename_check_extension(file_name_new)</strong>)
    file_new = os.path.join(EXPORT_DIR, safe_file_name_new)
    

    </code></pre>

</details>

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

  1. frigate/api/media.py
    <pre><code class="python">
    @MediaBp.route("/export/<file_name_current>/<file_name_new>", methods=["PATCH"])
    def export_rename(file_name_current, <strong>file_name_new</strong>: str):
    safe_file_name_current = secure_filename(
    export_filename_check_extension(file_name_current)
    </code></pre>

  2. frigate/api/media.py
    <pre><code class="python"> )

    safe_file_name_new = secure_filename(export_filename_check_extension(<strong>file_name_new</strong>))
    file_new = os.path.join(EXPORT_DIR, safe_file_name_new)
    

    </code></pre>

  3. frigate/api/media.py
    <pre><code class="python">

    def export_filename_check_extension(<strong>filename</strong>: str):
    if filename.endswith(".mp4"):
    return filename
    </code></pre>

  4. frigate/api/media.py
    <pre><code class="python"> return filename
    else:
    return <strong>filename + ".mp4"</strong>

    </code></pre>

  5. frigate/api/media.py
    <pre><code class="python"> )

    safe_file_name_new = secure_filename(<strong>export_filename_check_extension(file_name_new)</strong>)
    file_new = os.path.join(EXPORT_DIR, safe_file_name_new)
    

    </code></pre>

</details>


frigate/api/media.py

<pre><code class="python">@MediaBp.route("/export/<file_name>", methods=["DELETE"])
def export_delete(file_name: str):
safe_file_name = secure_filename(<strong>export_filename_check_extension(file_name)</strong>)
file = os.path.join(EXPORT_DIR, safe_file_name)

</code></pre>

This user-provided value can reach a costly Unicode normalization operation.

Paths

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

  1. frigate/api/media.py
    <pre><code class="python">
    @MediaBp.route("/export/<file_name>", methods=["DELETE"])
    def export_delete(<strong>file_name</strong>: str):
    safe_file_name = secure_filename(export_filename_check_extension(file_name))
    file = os.path.join(EXPORT_DIR, safe_file_name)
    </code></pre>

  2. frigate/api/media.py
    <pre><code class="python">@MediaBp.route("/export/<file_name>", methods=["DELETE"])
    def export_delete(file_name: str):
    safe_file_name = secure_filename(export_filename_check_extension(<strong>file_name</strong>))
    file = os.path.join(EXPORT_DIR, safe_file_name)

    </code></pre>

  3. frigate/api/media.py
    <pre><code class="python">

    def export_filename_check_extension(<strong>filename</strong>: str):
    if filename.endswith(".mp4"):
    return filename
    </code></pre>

  4. frigate/api/media.py
    <pre><code class="python">def export_filename_check_extension(filename: str):
    if filename.endswith(".mp4"):
    return <strong>filename</strong>
    else:
    return filename + ".mp4"
    </code></pre>

  5. frigate/api/media.py
    <pre><code class="python">@MediaBp.route("/export/<file_name>", methods=["DELETE"])
    def export_delete(file_name: str):
    safe_file_name = secure_filename(<strong>export_filename_check_extension(file_name)</strong>)
    file = os.path.join(EXPORT_DIR, safe_file_name)

    </code></pre>

</details>

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

  1. frigate/api/media.py
    <pre><code class="python">
    @MediaBp.route("/export/<file_name>", methods=["DELETE"])
    def export_delete(<strong>file_name</strong>: str):
    safe_file_name = secure_filename(export_filename_check_extension(file_name))
    file = os.path.join(EXPORT_DIR, safe_file_name)
    </code></pre>

  2. frigate/api/media.py
    <pre><code class="python">@MediaBp.route("/export/<file_name>", methods=["DELETE"])
    def export_delete(file_name: str):
    safe_file_name = secure_filename(export_filename_check_extension(<strong>file_name</strong>))
    file = os.path.join(EXPORT_DIR, safe_file_name)

    </code></pre>

  3. frigate/api/media.py
    <pre><code class="python">

    def export_filename_check_extension(<strong>filename</strong>: str):
    if filename.endswith(".mp4"):
    return filename
    </code></pre>

  4. frigate/api/media.py
    <pre><code class="python"> return filename
    else:
    return <strong>filename + ".mp4"</strong>

    </code></pre>

  5. frigate/api/media.py
    <pre><code class="python">@MediaBp.route("/export/<file_name>", methods=["DELETE"])
    def export_delete(file_name: str):
    safe_file_name = secure_filename(<strong>export_filename_check_extension(file_name)</strong>)
    file = os.path.join(EXPORT_DIR, safe_file_name)

    </code></pre>

</details>


frigate/api/media.py

<pre><code class="python">def preview_thumbnail(file_name: str):
"""Get a thumbnail from the cached preview frames."""
safe_file_name_current = secure_filename(<strong>file_name</strong>)
preview_dir = os.path.join(CACHE_DIR, "preview_frames")

</code></pre>

This user-provided value can reach a costly Unicode normalization operation.

Paths

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

  1. frigate/api/media.py
    <pre><code class="python">@MediaBp.route("/preview/<file_name>/thumbnail.jpg")
    @MediaBp.route("/preview/<file_name>/thumbnail.webp")
    def preview_thumbnail(<strong>file_name</strong>: str):
    """Get a thumbnail from the cached preview frames."""
    safe_file_name_current = secure_filename(file_name)
    </code></pre>

  2. frigate/api/media.py
    <pre><code class="python">def preview_thumbnail(file_name: str):
    """Get a thumbnail from the cached preview frames."""
    safe_file_name_current = secure_filename(<strong>file_name</strong>)
    preview_dir = os.path.join(CACHE_DIR, "preview_frames")

    </code></pre>

</details>

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

Technologies

Frigate Frigate

Weaknesses

CWE-770

CVSS scores

  • v3.19.3CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:H

MITRE ATT&CK

Inferred

Where this vulnerability fits in an attack

Initial Access Impact

References

Potentially impacted assets

See if this affects your attack surface

Latest trending attack

Criticalyesterday

Google Brotli decoder - Remote Code Execution via compressed requests (Exploitation Check)

This control is the second step of the Patrowl response to CVE-2026-111497 (Node2Shell). It complements the first control of 22 October 2026, which focused on the Node.js runtime, and does not replace it. Why a second control CVE-2026-111497 is an out-of-bounds write in the Google Brotli decoder, the library that decompresses Brotli ("br") data. It was first published as a Node.js vulnerability, because Node.js bundles this decoder. Later publications showed that the flaw is in the library itself. Every product that embeds an affected version of the decoder is concerned, whatever its language or vendor. A public proof of concept demonstrates code execution. Any server that decompresses request bodies sent with "Content-Encoding: br" exposes the decoder to unauthenticated attackers. Known cases include Express 5 and NestJS 11 on Node.js, Koa and Fastify setups, Bun, Envoy and Istio with request decompression enabled, and any application or reverse proxy that decodes Brotli request bodies with an affected library. The flaw also works in the other direction. A malicious server can compromise an unpatched client that decodes a Brotli response, for example Node.js fetch(), Python clients (requests, httpx, aiohttp, Scrapy) with the Brotli or brotlicffi package, or libcurl builds with Brotli support. What this control checks Patrowl sends small, valid Brotli-compressed requests to each asset and observes whether the server decodes them. The check does not depend on the technology: it detects the behaviour, whatever the stack behind it. These requests are what any legitimate client could send. They never reach the vulnerable code path and cannot affect the availability of the service. How to read the result Potentially impacted means the asset decodes Brotli request bodies: the attack surface is exposed. It does not confirm that the asset is vulnerable. The version of the Brotli decoder in use is not visible from the outside. This check covers applications that parse request bodies on their root path. A Not impacted result does not rule out exposure on other routes, nor on the client side. Checking the versions on the servers remains the only exhaustive verification. Affected and fixed versions Google Brotli 1.0.3 to 1.2.0 are affected, fixed in 1.0.10, 1.1.1 and 1.2.1. Fixed releases of the main products embedding it: Node.js 22.23.4, 24.22.1 and 26.12.1 (end-of-life lines 20.x and older and 25.x receive no fix), Bun 1.4.4, Envoy 1.37.8, 1.38.6, 1.39.3 and 1.40.0, Istio 1.29.9, 1.30.6 and 1.31.2, Python Brotli 1.2.1 and brotlicffi 1.2.1.0. Products that link against the system library depend on the Brotli package of the Linux distribution. Recommendations Update every component that embeds the Brotli decoder (only real fix). Start with the assets flagged by this control. Restart the processes after the update. Rebuild containers, single-executable applications and appliances that bundle an affected runtime or library. Reduce the exposure until the update is deployed. Reject requests with "Content-Encoding: br" at the reverse proxy, load balancer or WAF, case-insensitively and including lists such as "gzip, br". On Envoy and Istio, disable request decompression for Brotli. Review outbound calls. List the features that fetch content from servers you do not control, and patch the services that host them first.

Take 15 minutes to discover our platform with our experts

Patrowl Intel platform screenshot