# CVE-2026-85608: Douyin_TikTok_Download_API 4.1.2 SSRF via url parameter

The Markdown version of <https://upatch.dev/cve/CVE-2026-85608>. Last updated 25 Nov 2026.

## At a glance

CVE-2026-85608 is rated High 8.7 (CVSS 4.0, CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/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). It affects Douyin_TikTok_Download_API (Evil0ctal) and was published on 4 Sept 2026. It is not in CISA's Known Exploited Vulnerabilities catalog. Its EPSS score is 0.5%: the estimated chance it is exploited in the next 30 days, as of 25 Nov 2026. The upatch `cve-2026-85608-ssrf-block` mitigates it, and is vetted (merged into the registry).

A upatch is a signed BPF program that shirudo loads into a running Linux kernel to block the code path this CVE's exploit takes. It holds the line until the fix ships; it does not replace patching.

## The vulnerability

CVE-2026-85608, published on 4 September 2026, is an unauthenticated full-read server-side request forgery (CWE-918) in `Evil0ctal/Douyin_TikTok_Download_API` through version `V4.1.2`. The `/api/download` (`download_file_hybrid` in `app/api/endpoints/download.py`) and `/api/hybrid/video_data` (`hybrid_parsing_single_video` in `app/api/endpoints/hybrid_parsing.py`) endpoints pass the caller-supplied `url` query parameter to `HybridCrawler.hybrid_parsing_single_video` in `crawlers/hybrid/hybrid_crawler.py`. When the string `"douyin"` appears anywhere in `url`, the dispatcher invokes `AwemeIdFetcher.get_aweme_id` in `crawlers/douyin/web/utils.py`, which validates the URL only with `extract_valid_urls` (`https?://\S+` in `crawlers/utils/utils.py`) and fetches it with `httpx.AsyncClient(follow_redirects=True)`. An unauthenticated caller can supply an internal or cloud metadata URL containing `"douyin"` in the path or query string (such as `http://169.254.169.254/latest/meta-data/douyin` or `http://127.0.0.1:<port>/douyin`) to make the server request internal endpoints, and `AwemeIdFetcher.get_aweme_id` includes `e.response.text` in the `APIResponseError` message reflected back by `/api/download`.

### Official description

Douyin_TikTok_Download_API through 4.1.2 contains a server-side request forgery vulnerability in the /api/download and /api/hybrid/video_data endpoints that allows unauthenticated attackers to fetch arbitrary URLs by supplying a url query parameter. Attackers can request internal services including cloud metadata endpoints and retrieve response bodies containing sensitive credentials through error messages.

## What the upatch does

The BPF LSM program `cve_2026_85608_ssrf_block` attaches to `lsm/socket_connect` and returns `-EPERM` when a `Douyin_TikTok_Download_API` server process (a process whose executable name starts with `python` and whose command name is `uvicorn` or `start.py` or whose working directory starts with `Douyin_TikTok_Download_API`) attempts to connect an `AF_INET` or `AF_INET6` socket to any of these internal ranges:

- IPv4: `0.0.0.0/8` (unspecified), `10.0.0.0/8`, `172.16.0.0/12`, and `192.168.0.0/16` (RFC 1918 private networks), `100.64.0.0/10` (RFC 6598 carrier-grade NAT and Alibaba Cloud metadata), `127.0.0.0/8` (loopback), and `169.254.0.0/16` (link-local and AWS/GCP/Azure metadata `169.254.169.254`).
- IPv6: `::` and `::1`, IPv4-compatible, IPv4-mapped (`::ffff:0:0/96`), NAT64 (`64:ff9b::/96`), and 6to4 (`2002::/16`) addresses embedding any of the blocked IPv4 ranges, unique-local (`fc00::/7`), and link-local (`fe80::/10`).

The program checks the socket family and destination IP address first, and inspects the current task's executable, command name, and working directory only when the destination falls inside a blocked internal range. Because `lsm/socket_connect` runs on every connection attempt, both direct requests to internal addresses and HTTP redirects from public hosts to internal addresses are refused in the kernel before a packet is sent. Any refusal from an earlier BPF LSM program on the same hook is preserved. Refusals are counted at key 0 of the `refused` per-CPU array map.

The policy: [`cve-2026-85608-ssrf-block.bpf.c`](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-85608), 172 lines of BPF C attached at `lsm/socket_connect`, licensed GPL-2.0 OR BSD-2-Clause.

## Side effects

- Outbound `AF_INET` and `AF_INET6` connections from `Douyin_TikTok_Download_API` (`uvicorn` / `start.py`) to loopback, private, link-local, CGNAT, and cloud metadata addresses fail with `EPERM`, causing `/api/download` and `/api/hybrid/video_data` to return HTTP 400 (`APIConnectionError`) when given an internal URL.
- Inbound connections to `Douyin_TikTok_Download_API` on loopback or private interfaces continue to work because `accept` does not call `socket_connect`, and outbound connections to public Douyin and TikTok hosts are unaffected.
- Other processes on the machine, including `sshd`, system daemons, and standalone `python3` scripts outside `Douyin_TikTok_Download_API`, are unaffected.
- Not covered: a deployment started under a custom process name other than `uvicorn` or `start.py` from a working directory that does not start with `Douyin_TikTok_Download_API`, or an internal service running on a public IP address.

## Preemption model and cost

The program holds no locks and shares only the per-CPU `refused` counter, updated with `__sync_fetch_and_add`, making it safe under all kernel preemption models including `PREEMPT_LAZY`, `PREEMPT_DYNAMIC`, and `PREEMPT_RT`. On every `socket_connect` to a public address or non-IP socket family, the program reads only `sa_family` and the destination address and returns immediately without inspecting task structures.

## Affected versions

- `Evil0ctal/Douyin_TikTok_Download_API`: all versions through `V4.1.2` (commit `ab87be4`, released 16 March 2026). Upstream closed issue #729 without a V4 patch because the V4 branch is frozen in favor of the V5 rewrite.
- Kernels: any Linux kernel supported by shirudo with BPF LSM and BTF enabled (`lsm/socket_connect`).

## How it was tested

On Douyin_TikTok_Download_API V4.1.2, the loaded upatch refused outbound loopback connections from /api/download at lsm/socket_connect while normal API endpoints kept working.

- **Tested:** 25 Nov 2026
- **Target:** Evil0ctal/Douyin_TikTok_Download_API V4.1.2 on Python 3.11 (uvicorn), loopback only (127.0.0.1:18765)
- **Kernel:** 7.4-shirudo-ci-20261123
- **Architecture:** x86_64
- **Distribution:** Ubuntu 26.04

### Results

| State           | SSRF probe to internal loopback listener blocked | Normal API endpoint (/api/ios/shortcut) works |
| --------------- | ------------------------------------------------ | --------------------------------------------- |
| Before loading  | no                                               | yes                                           |
| Upatch loaded   | yes                                              | yes                                           |
| After unloading | no                                               | yes                                           |

## How to apply

Build the upatch from source, sign it with your own shirudo key, and publish it to your own OCI registry. Machines that follow your upatch tree load it within about a minute.

Build and sign:

```sh
git clone https://github.com/copper-helm/upatch-registry
cd upatch-registry
tools/build <shirudo-checkout> <keys-dir> 1.0.0 upatches/cve-2026-85608
```

Publish and roll out:

```sh
shirudo bpm push build/packages/cve-2026-85608-1.0.0.bee oci://<registry>/<namespace>/cve-2026-85608 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-85608-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>
```

## Review

- Contributors: romanlab.
- Reviewers: none recorded yet.

## Sources and links

- [Evil0ctal/Douyin_TikTok_Download_API repository](https://github.com/Evil0ctal/Douyin_TikTok_Download_API)
- [Release V4.1.2 (`ab87be4`)](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/releases/tag/V4.1.2)
- [Vulnerable `AwemeIdFetcher.get_aweme_id` in `crawlers/douyin/web/utils.py`](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/V4.1.2/crawlers/douyin/web/utils.py)
- [Upstream issue #729](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/issues/729)
- [VulnCheck advisory for CVE-2026-85608](https://www.vulncheck.com/advisories/douyin-tiktok-download-api-4.1.2-ssrf-via-url-parameter)

### Links

- [CVE-2026-85608 on upatch.dev](https://upatch.dev/cve/CVE-2026-85608) (this page, as HTML)
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2026-85608)
- [CVE.org](https://www.cve.org/CVERecord?id=CVE-2026-85608)
- [CWE-918](https://cwe.mitre.org/data/definitions/918.html)
- Upatch source: [upatches/cve-2026-85608](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-85608)

### More references from NVD (4)

- [github.com](https://github.com/Evil0ctal/Douyin_TikTok_Download_API)
- [github.com](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/V4.1.2/crawlers/douyin/web/utils.py)
- [github.com](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/issues/729)
- [vulncheck.com](https://www.vulncheck.com/advisories/douyin-tiktok-download-api-4.1.2-ssrf-via-url-parameter)
