# pyLoad API.set_user_permission session invalidation bypass

Source: https://junglewise.ai/threats/pyload-api-set-user-permission-never-invalidates-the-target-s-session-9c452634  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-09. Updated: 2026-10-09  
License: CC BY 4.0 with a link back

Severity: high · CVSS 7.5 · Published 2026-10-09

pyLoad is a download manager that includes a web-based administrative interface. When an admin revokes or downgrades a user's permissions through the API (rather than the web UI), the user's active session is not invalidated. The demoted user can continue using their old session cookie for up to 31 days, maintaining their previously-elevated access to sensitive features and API endpoints despite their permissions being revoked.

Technologies: [pyLoad](https://junglewise.ai/threats/technologies/pyload), [pyload-ng (PyPI)](https://junglewise.ai/threats/technologies/pyload-ng). Vendors: [pyLoad](https://junglewise.ai/threats/vendors/pyload), [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** High severity, with a CVSS score of 7.5, published 9 October 2026.

**Which products and versions are affected?** pyLoad at least up to commit 31e341fd41d2dac9fffa3683a756edc54bcdeb77; pyload-ng (PyPI) >= 0.5.0b3.dev98, <= 0.5.0b3.dev101.

**Is there a fix for This vulnerability?** No fixed version is recorded yet. Restrict access to the `/api/set_user_permission` endpoint to prevent non-admin users from calling it, or use API key authentication instead of session cookies for administrative operations (API keys fetch permissions fresh from the database on each request). If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is This vulnerability attacked?** It is attacked over the network, in a web application.

**Am I affected?** Check whether you run pyLoad or pyload-ng (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix


Restrict access to the `/api/set_user_permission` endpoint to prevent non-admin users from calling it, or use API key authentication instead of session cookies for administrative operations (API keys fetch permissions fresh from the database on each request).

## Technical details

The vulnerability is a privilege escalation via stale session caching. When `Api.set_user_permission()` updates a user's role/permission in the database, it fails to call `clear_all_user_sessions()`, unlike the WebUI's corresponding route. Cookie-authenticated users have their role and permission bits cached in the Flask session at login and never refreshed on subsequent requests; the authorization check only re-validates that the username still exists, not that cached permissions match the current database state. An authenticated user demoted while logged in retains pre-demotion privileges via their unchanged session cookie for the session lifetime (~31 days).

## Affected products

- pyload pyload at least up to commit 31e341fd41d2dac9fffa3683a756edc54bcdeb77

## Timeline

- 2026-10-09: disclosed

## Related threats

- [pyLoad API key validation cache authentication bypass](https://junglewise.ai/threats/cve-2026-123816-pyload-is-a-free-and-open-source-download-manager-written-in)
- [pyLoad WindowsPhoneNotify SSRF in notification addon](https://junglewise.ai/threats/cve-2026-123814-pyload-is-a-free-and-open-source-download-manager-written-in)
- [pyLoad unauthenticated template access and information disclosure](https://junglewise.ai/threats/cve-2026-75597-pyload-unauthenticated-access-to-web-path-filename-bypasses)
- [pyLoad API denial of service in multipart file upload handling](https://junglewise.ai/threats/cve-2026-48484-pyload-lack-of-input-size-validation-leads-to-denial-of-service)
- [pyload-ng authentication bypass in getUserData/get_userdata](https://junglewise.ai/threats/pyload-ng-getuserdata-get-userdata-exposed-at-perms-any-allow-any-cd197c9d)
