Skip to content

fix(plex-allowlist): add missing HTTP status codes for streaming#1728

Merged
blotus merged 1 commit intocrowdsecurity:masterfrom
com6056:fix/plex-allowlist-missing-status-codes
Mar 18, 2026
Merged

fix(plex-allowlist): add missing HTTP status codes for streaming#1728
blotus merged 1 commit intocrowdsecurity:masterfrom
com6056:fix/plex-allowlist-missing-status-codes

Conversation

@com6056
Copy link
Contributor

@com6056 com6056 commented Mar 14, 2026

Problem

The plex-allowlist parser is missing several HTTP status codes that are produced by normal Plex client activity, causing legitimate Plex traffic to trigger scenarios like http-crawl-non-statics and http-probing.

Missing status codes

206 Partial Content on /video/:/transcode/ and /music/:/transcode/universal/session/
Video and audio streaming use HTTP range requests, which return 206, not 200. This is probably the most common false positive — any active stream will generate a flood of 206 responses that look like crawling to CrowdSec.

403 Forbidden on /video/:/transcode/ and /:/timeline
When a Plex session's auth token expires mid-stream (e.g. the user pauses for a long time), the Plex client continues sending stop/session/timeline requests that return 403. These contain session IDs in the URL and are clearly normal client behavior.

403 and 404 on /library/metadata/
Plex clients regularly fetch metadata that returns 403 (auth expired) or 404 (not found locally). Additionally, the existing ^\d+ regex doesn't match plex:// GUID-style paths (e.g. /library/metadata/plex%3A%2F%2Fmovie%2F5d776...) that Plex uses for watch-together and discover features.

206 on /photo/:/transcode/
Photo/thumbnail range requests can also return 206.

Changes

  • /video/:/transcode/: add 206, 403
  • /photo/:/transcode/: add 206
  • /:/timeline: add 403
  • /library/metadata/: add 403, 404; replace ^\d+ regex with startsWith to cover plex:// GUIDs
  • /music/:/transcode/universal/session/: add 206

🤖 Generated with Claude Code

- Add 206 (Partial Content) to /video/:/transcode/ and /music/:/transcode/
  Video and audio streaming use HTTP range requests which return 206, not
  200. Without this, active streams trigger http-crawl-non-statics and
  http-probing scenarios.

- Add 403 to /video/:/transcode/ and /:/timeline
  When a Plex session's auth token expires mid-stream, the client
  continues sending requests that return 403. These are normal Plex
  client behaviors, not attacks.

- Extend /library/metadata/ to cover 403, 404, and plex:// URIs
  Replaced the ^\d+ regex with a startsWith check to also match
  plex:// GUID paths (e.g. plex%3A%2F%2Fmovie%2F...) which Plex
  clients request when looking up media. Added 403/404 status codes
  for auth-expired and not-found responses.

- Add 206 to /photo/:/transcode/
  Thumbnail/image requests can also use range requests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@blotus blotus merged commit b02a654 into crowdsecurity:master Mar 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants