---
id: CVE-2024-8309
aliases:
  - GHSA-45pg-36p6-83v9
  - PYSEC-2024-115
  - PYSEC-2026-1507
title: Langchain SQL Injection vulnerability
summary: Langchain SQL Injection vulnerability
severity: medium
cvss: 4.9
cvssVector: 'CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L'
vendor: langchain-community
product: langchain-community
ecosystem: pip
affected:
  - 'langchain-community >= 0.2.0, < 0.2.19'
  - langchain < 0.2.0
patched:
  - langchain-community 0.2.19
  - langchain 0.2.0
published: '2024-10-29'
updated: '2026-07-07'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GHSA-45pg-36p6-83v9'
references:
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2024-8309'
  - url: >-
      https://github.com/langchain-ai/langchain/commit/64c317eba05fbac0c6a6fc5aa192bc0d7130972e
  - url: >-
      https://github.com/langchain-ai/langchain/commit/c2a3021bb0c5f54649d380b42a0684ca5778c255
  - url: 'https://github.com/langchain-ai/langchain'
  - url: >-
      https://github.com/pypa/advisory-database/tree/main/vulns/langchain/PYSEC-2024-115.yaml
  - url: 'https://huntr.com/bounties/8f4ad910-7fdc-4089-8f0a-b5df5f32e7c5'
tags:
  - osv
  - pip
  - exploit-available
epss: 0.13738
epssPercentile: 0.9634
ingestedAt: '2026-07-08T18:25:45.255Z'
exploits:
  github: 1
  githubRepos:
    - 'https://github.com/liadlevy/CVE-2024-8309'
  checkedAt: '2026-09-24T07:52:52.040Z'
exploitAvailable: true
---

## Overview

A vulnerability in the GraphCypherQAChain class of langchain-ai/langchain version 0.2.5 allows for SQL injection through prompt injection. This vulnerability can lead to unauthorized data manipulation, data exfiltration, denial of service (DoS) by deleting all data, breaches in multi-tenant security environments, and data integrity issues. Attackers can create, update, or delete nodes and relationships without proper authorization, extract sensitive data, disrupt services, access data across different tenants, and compromise the integrity of the database.

## Affected packages

- `langchain-community >= 0.2.0, < 0.2.19`
- `langchain < 0.2.0`

## Remediation

Upgrade to a patched release:

- `langchain-community 0.2.19`
- `langchain 0.2.0`
