{"id":"CVE-2024-52294","aliases":["CVE-2024-52294","GHSA-hq4h-w933-jm6c","PYSEC-2026-1493"],"related":[],"kind":"vulnerability","state":"published","title":"khoj has an IDOR in subscription management that allows unauthorized subscription modifications","summary":"Khoj is a self-hostable artificial intelligence app. Prior to version 1.29.10, 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. 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. The issue was fixed in version 1.29.10. Support for arbitrarily presenting an email for update has been deprecated.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Khoj is a self-hostable artificial intelligence app. Prior to version 1.29.10, 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. 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. The issue was fixed in version 1.29.10. Support for arbitrarily presenting an email for update has been deprecated.","source":"cvelist"},{"lang":"en","text":"### Summary\nAn 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.\n\n### Details\nThe 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.\n\nVulnerable code in `/api/subscription`:\n```python\n@subscription_router.patch(\"\")\n@requires([\"authenticated\"])\nasync def update_subscription(request: Request, email: str, operation: str):\n    # IDOR: email parameter directly references user subscriptions without ownership verification\n    customers = stripe.Customer.list(email=email).auto_paging_iter()\n    customer = next(customers, None)\n    \n    if operation == \"cancel\":\n        # Any authenticated user can modify any subscription referenced by email\n        customer_id = customer.id\n        for subscription in stripe.Subscription.list(customer=customer_id):\n            stripe.Subscription.modify(subscription.id, cancel_at_period_end=True)\n```\n\n### PoC\n1. Create a customer account in stripe:\n   - Customer A: `adventure8812@zeropath.com` (attacker)\n\n2. Log in as any user.\n\n3. Send this request:\n```http\nPATCH /api/subscription?email=adventure8812@zeropath.com&operation=cancel HTTP/1.1\n```\n\n4. The subscription for Customer A is successfully set to cancel.\n\n### Impact\nHigh:\nRevenue loss via mass cancellation of subscriptions.\nLoss of customer trust by re-enabling subscriptions they had set to cancel.\n\n### Resolution\n\nThis 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Khoj es una aplicación de inteligencia artificial autoalojada. Antes de la versión 1.29.10, una vulnerabilidad de referencia directa a objetos inseguros (IDOR) en el punto de conexión update_subscription permite que cualquier usuario autenticado manipule las suscripciones de Stripe de otros usuarios simplemente modificando el parámetro de correo electrónico en la solicitud. La vulnerabilidad existe en el punto de conexión de suscripción en `/api/subscription`. El punto de conexión usa un parámetro de correo electrónico como referencia directa a las suscripciones de los usuarios sin verificar la propiedad del objeto. Si bien se requiere autenticación, no hay una verificación de autorización para verificar si el usuario autenticado posee la suscripción a la que se hace referencia. El problema se solucionó en la versión 1.29.10. La compatibilidad con la presentación arbitraria de un correo electrónico para la actualización ha quedado obsoleta.","source":"nvd"}],"published":"2024-12-30T16:12:40.000Z","modified":"2026-09-10T03:50:21.586Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","score":4.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","score":4.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","score":4.3,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-639"],"affected":[{"ranges":[{"version":"< 1.29.0","status":"affected"}],"vendor":"khoj-ai","product":"khoj","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.29.0"}],"ecosystem":"PyPI","package":"khoj","purl":"pkg:pypi/khoj","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.29.0"}],"ecosystem":"PyPI","package":"khoj","purl":"pkg:pypi/khoj","source":"pysec"}],"references":[{"url":"https://github.com/khoj-ai/khoj/security/advisories/GHSA-hq4h-w933-jm6c","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/khoj-ai/khoj/commit/47d3c8c23597900af708bdc60aced3ae5d2064c1","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-52294","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/khoj-ai/khoj","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/khoj","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-hq4h-w933-jm6c","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2024-12-30T16:52:16.974Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-52294","url":"https://www.cve.org/CVERecord?id=CVE-2024-52294","licence":"CVE Terms of Use","modified":"2024-12-30T16:52:29.814Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hq4h-w933-jm6c","url":"https://github.com/advisories/GHSA-hq4h-w933-jm6c","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:21.586Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-52294","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-52294","licence":"Public domain","modified":"2026-06-17T08:06:57.457Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1493","url":"https://osv.dev/vulnerability/PYSEC-2026-1493","licence":"CC-BY-4.0","modified":"2026-07-07T17:46:46.025Z"}],"updatedAt":"2026-11-25T22:58:50.581Z","epss":{"score":0.00432,"percentile":0.3929,"date":"2026-12-01T12:00:22.000Z"}}