CVE-2026-123813
Flask sessions not cleared after user role/password change, retaining rights.
- CVSS 7.5
- CWE-613
- Authentication, Authorization, and Session Management
- Remote
pyLoad is a free and open-source download manager written in Python. Prior to 0.5.0b3.dev102, pyLoad does not invalidate existing Flask sessions when an administrator changes a user's permissions or password through /api/set_user_permission or /api/change_password. Api.set_user_permission and Api.change_password update the database, but session authorization continues to use role and permission values copied at login by set_session in webui/app/helpers.py. A user can therefore retain revoked privileges or continue using a session established with an old password for the configured session lifetime. API-key authentication is not affected because that path rereads user data from the database. This issue is fixed in version 0.5.0b3.dev102.
- CWE
- CWE-613
- CVSS base score
- 7.5
- Published
- 2026-11-09
- OWASP
- A01 Broken Access Control
- Orthogonal defect classification
- Assignment
- Code defect classification
- Missing Check
- Category
- Authentication, Authorization, and Session Management
- Subcategory
- Session Management Issues
- Accessibility scope
- Remote
- Impact
- Privilege Escalation
- Affected component
- pyLoad
- Fixed by upgrading
- Yes
Solution
Upgrade pyLoad to version 0.5.0b3.dev102 or later.
Vulnerable code sample
from flask import session, request, jsonify
import db
def set_user_permission(user_id, new_role):
# VULNERABLE: session retains old role after permission change
db.execute(
"UPDATE users SET role = %s WHERE id = %s",
(new_role, user_id)
)
return jsonify({"status": "ok"})
def change_password(user_id, new_password):
# VULNERABLE: session retains old password hash after change
db.execute(
"UPDATE users SET password_hash = %s WHERE id = %s",
(new_password, user_id)
)
return jsonify({"status": "ok"})Patched code sample
from flask import session, request, jsonify
import db
def set_user_permission(user_id, new_role):
# FIX: invalidate session so new role is re-evaluated
db.execute(
"UPDATE users SET role = %s WHERE id = %s",
(new_role, user_id)
)
session.clear()
return jsonify({"status": "ok"})
def change_password(user_id, new_password):
# FIX: invalidate session so new credentials are required
db.execute(
"UPDATE users SET password_hash = %s WHERE id = %s",
(new_password, user_id)
)
session.clear()
return jsonify({"status": "ok"})Published fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- Move session invalidetion from json blueprint to the API level (fixes GHSA-889w-m37p-88m5 and GHSA-jq7h-wrvp-3rgx security advisories) (pyload/pyload)
src/pyload/core/api/__init__.py,src/pyload/core/api/__init__.py · Api.change_password,src/pyload/core/api/__init__.py · Api.remove_user,src/pyload/core/api/__init__.py · Api.set_user_permission,src/pyload/core/api/__init__.py · Api.__init__,src/pyload/core/database/user_database.py,src/pyload/webui/app/blueprints/json_blueprint.py,src/pyload/webui/app/blueprints/json_blueprint.py · change_password,src/pyload/webui/app/blueprints/json_blueprint.py · update_users,src/pyload/webui/app/helpers.py · clear_all_user_sessions,src/pyload/webui/app/__init__.py,src/pyload/webui/app/__init__.py · App._configure_session
Cite this entry
@misc{vaitp:cve2026123813,
title = {{Flask sessions not cleared after user role/password change, retaining rights.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-123813},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-123813/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
