Skip to content
Heist/ feed
Back to feed
Medium

Path Traversal in langchain-ai/langchainjs

Type: advisorySources: OSV

A path traversal vulnerability exists in the `getFullPath` method of langchain-ai/langchainjs version 0.2.5. This vulnerability allows attackers to save files anywhere in the filesystem, overwrite existing text files, read `.txt` files, and delete files. The vulnerability is exploited through the `setFileContent`, `getParsedFile`, and `mdelete` methods, which do not properly sanitize user input.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2024-7774
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 02:32 UTC · Revision 1

Source evidence

Path Traversal in langchain-ai/langchainjs

core-osv · Original source

Published 29 Oct 2024, 12:49 UTC

A path traversal vulnerability exists in the `getFullPath` method of langchain-ai/langchainjs version 0.2.5. This vulnerability allows attackers to save files anywhere in the filesystem, overwrite existing text files, read `.txt` files, and delete files. The vulnerability is exploited through the `setFileContent`, `getParsedFile`, and `mdelete` methods, which do not properly sanitize user input.

osv:CVE-2024-7774
Complete source record
{
  "id": "064339abe7960eea6b0f62d8c54300aa53fccf1c78bffba13ec255b4715a33af",
  "url": "https://osv.dev/vulnerability/CVE-2024-7774",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Path Traversal in langchain-ai/langchainjs",
    "summary": "A path traversal vulnerability exists in the `getFullPath` method of langchain-ai/langchainjs version 0.2.5. This vulnerability allows attackers to save files anywhere in the filesystem, overwrite existing text files, read `.txt` files, and delete files. The vulnerability is exploited through the `setFileContent`, `getParsedFile`, and `mdelete` methods, which do not properly sanitize user input.",
    "evidence": "osv:CVE-2024-7774",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2024-7774",
      "aliases": [
        "CVE-2024-7774",
        "GHSA-hc5w-c9f8-9cc4"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/langchain-ai/langchainjs",
              "type": "GIT",
              "events": [
                {
                  "introduced": "f51f338cf4dd3ba188b048b3bfa8134e9b9a64cf"
                },
                {
                  "fixed": "a0fad77d6b569e5872bd4a9d33be0c0785e538a9"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:langchain:langchain.js:0.2.5:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0.2.5"
                      },
                      {
                        "last_affected": "0.2.5"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "range": [
                      {
                        "fixed": "a0fad77d6b569e5872bd4a9d33be0c0785e538a9"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "0.2.5"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-7774.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:32.512237129Z",
      "provider": "osv",
      "references": [
        "https://huntr.com/bounties/8fe40685-b714-4191-af7a-3de5e5628cee",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/7xxx/CVE-2024-7774.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-7774",
        "https://github.com/langchain-ai/langchainjs/commit/a0fad77d6b569e5872bd4a9d33be0c0785e538a9"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-29"
        ],
        "cna_assigner": "@huntr_ai",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/7xxx/CVE-2024-7774.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-7774",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 499694,
  "published_at": "2024-10-29T12:49:21.165+00:00"
}