khoj has an IDOR in subscription management allows unauthorized subscription modifications
Summary
An Insecure Direct Object Reference (IDOR) vulnerability in the update_subscription endpoint allows any authenticated user to manipulate other users' Stripe subscriptions by simply modifying the email parameter in the request.
Details
The vulnerability exists in the subscription endpoint at /api/subscription. The endpoint uses an email parameter as a direct reference to user subscriptions without verifying object ownership. While authentication is required, there is no authorization check to verify if the authenticated user owns the referenced subscription.
Vulnerable code in /api/subscription:
@subscription_router.patch("")
@requires(["authenticated"])
async def update_subscription(request: Request, email: str, operation: str):
# IDOR: email parameter directly references user subscriptions without ownership verification
customers = stripe.Customer.list(email=email).auto_paging_iter()
customer = next(customers, None)
if operation == "cancel":
# Any authenticated user can modify any subscription referenced by email
customer_id = customer.id
for subscription in stripe.Subscription.list(customer=customer_id):
stripe.Subscription.modify(subscription.id, cancel_at_period_end=True)
PoC
-
Create a customer account in stripe:
- Customer A:
adventure8812@zeropath.com(attacker)
- Customer A:
-
Log in as any user.
-
Send this request:
PATCH /api/subscription?email=adventure8812@zeropath.com&operation=cancel HTTP/1.1
- The subscription for Customer A is successfully set to cancel.
Impact
High: Revenue loss via mass cancellation of subscriptions. Loss of customer trust by re-enabling subscriptions they had set to cancel.
Resolution
This was fixed in the following commit which limited subscription update operations to the authenticated user: https://github.com/khoj-ai/khoj/commit/47d3c8c23597900af708bdc60aced3ae5d2064c1. Support for arbitrarily presenting an email for update has been deprecated.
Czego dotyczy
Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.
| Platforma | Paczka | Podatne wersje | Poprawka w wersji |
|---|---|---|---|
| Python (PyPI) | khoj | < 1.29.0 | 1.29.0 |
Odnośniki
- https://github.com/khoj-ai/khoj/security/advisories/GHSA-hq4h-w933-jm6c
- https://nvd.nist.gov/vuln/detail/CVE-2024-52294
- https://github.com/khoj-ai/khoj/commit/47d3c8c23597900af708bdc60aced3ae5d2064c1
- https://github.com/khoj-ai/khoj
- https://pypi.org/project/khoj
- https://github.com/advisories/GHSA-hq4h-w933-jm6c
- Wektor CVSS
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N- Słabość (CWE)
CWE-639- Platforma
- Python (PyPI)
- Paczka
khoj- Ujawniono
- 30.12.2024
- Aktualizacja
- 11.10.2026 15:17
Źródła i licencje
OSV / GitHub Advisory Database - PYSEC-2026-1493 - PyPA Advisory Database; CC BY 4.0
OSV / GitHub Advisory Database - GHSA-hq4h-w933-jm6c - CC BY 4.0
Historia podatności: khoj
Wszystkie opisane podatności tej paczki (Python (PyPI)), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.
- Wszystkich wpisów
- 4
- Pierwsza → ostatnia
- 08.2024 09.2026
- Bez poprawki
- 1
- Wykorzystywana w atakach
- 0
Rozkład istotności
- Wysoka 1
- Średnia 3
Ujawnienia w latach
- 2024: 2
- 2025: 0
- 2026: 2
-
khoj has an IDOR in subscription management allows unauthorized subscription modifications ten wpis
Dowiedz się, które podatności dotyczą Twojej aplikacji
Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.