CVE-2026-125362
Weak randomness in Seahub share link passwords allows state recovery and prediction.
- CVSS 2.3
- CWE-338
- Cryptographic
- Remote
Seahub through 14.0.10 contains a weak randomness vulnerability in MultiShareLinksBatch.post() that generates batch share link passwords using Python's non-cryptographic random.choices(). Authenticated users permitted to create share links can request many generated passwords via the multi-share-links batch endpoint, recover the Mersenne Twister state, and predict other users' share link passwords.
- CWE
- CWE-338
- CVSS base score
- 2.3
- Published
- 2026-11-10
- OWASP
- A02 Cryptographic Failures
- Orthogonal defect classification
- Algorithm
- Code defect classification
- Incorrect Algorithm
- Category
- Cryptographic
- Subcategory
- Inadequate random number generation
- Accessibility scope
- Remote
- Impact
- Unauthorized Access
- Affected component
- Python
Solution
Upgrade Seahub to version 14.0.11 or later, which replaces the non‑cryptographic random generator with a secure one for batch share‑link passwords.
Vulnerable code sample
import random
from typing import List, Dict
class MultiShareLinksBatch:
def __init__(self, db):
self.db = db
def post(self, user_id: int, targets: List[Dict]) -> List[str]:
"""Create share links for multiple targets and return passwords."""
passwords = []
for target in targets:
# VULNERABLE: uses non‑cryptographic RNG for passwords
pwd = ''.join(random.choices('abcdefghijklmnopqrstuvwxyz0123456789', k=8))
self.db.execute(
"INSERT INTO share_links (user_id, target_id, password) VALUES (?, ?, ?)",
(user_id, target['id'], pwd)
)
passwords.append(pwd)
return passwordsPatched code sample
import random
import secrets
from typing import List, Dict
class MultiShareLinksBatch:
def __init__(self, db):
self.db = db
def post(self, user_id: int, targets: List[Dict]) -> List[str]:
"""Create share links for multiple targets and return passwords."""
passwords = []
for target in targets:
# FIX: uses cryptographically secure RNG for passwords
pwd = ''.join(secrets.choice('abcdefghijklmnopqrstuvwxyz0123456789') for _ in range(8))
self.db.execute(
"INSERT INTO share_links (user_id, target_id, password) VALUES (?, ?, ?)",
(user_id, target['id'], pwd)
)
passwords.append(pwd)
return passwordsPublished 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.
- update share link password generator (haiwen/seahub)
seahub/api2/endpoints/multi_share_links.py,seahub/api2/endpoints/multi_share_links.py · MultiShareLinksBatch.post
Cite this entry
@misc{vaitp:cve2026125362,
title = {{Weak randomness in Seahub share link passwords allows state recovery and prediction.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-125362},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-125362/}}
}
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 ::
