Track vulnerabilities like this one.
Sign up free to get alerted when software you use is affected.
3.7
CVE-2024-0243: Crawler Fails to Ignore Malicious Links on Host
CVE-2024-0243 · published 2 years ago
Summary
An attacker can trick the crawler into downloading files from outside the intended domain by manipulating links on the target website. This could lead to unauthorized access to sensitive information. Update the crawler configuration to prevent this by using a more secure URL validation method.
What to do
- Update langchain to version 0.1.0.
- Update langchain langchain to version 0.1.0 or later.
Affected software
| Ecosystem | Vendor | Product | Affected versions |
|---|---|---|---|
| pip | – | langchain |
< 0.1.0 Fix: upgrade to 0.1.0
|
| – | langchain | langchain |
< 0.1.0 cpe:2.3:a:langchain:langchain:*:*:*:*:*:*:*:* |
Original advisory text
Server-side Request Forgery In Recursive URL Loader
With the following crawler configuration:
```python
from bs4 import BeautifulSoup as Soup
url = "https://example.com"
loader = RecursiveUrlLoader(
url=url, max_depth=2, extractor=lambda x: Soup(x, "html.parser").text
)
docs = loader.load()
```
An attacker in control of the contents of `https://example.com` could place a malicious HTML file in there with links like "https://example.completely.different/my_file.html" and the crawler would proceed to download that file as well even though `prevent_outside=True`.
https://github.com/langchain-ai/langchain/blob/bf0b3cc0b5ade1fb95a5b1b6fa260e99064c2e22/libs/community/langchain_community/document_loaders/recursive_url_loader.py#L51-L51
Resolved in https://github.com/langchain-ai/langchain/pull/15559
```python
from bs4 import BeautifulSoup as Soup
url = "https://example.com"
loader = RecursiveUrlLoader(
url=url, max_depth=2, extractor=lambda x: Soup(x, "html.parser").text
)
docs = loader.load()
```
An attacker in control of the contents of `https://example.com` could place a malicious HTML file in there with links like "https://example.completely.different/my_file.html" and the crawler would proceed to download that file as well even though `prevent_outside=True`.
https://github.com/langchain-ai/langchain/blob/bf0b3cc0b5ade1fb95a5b1b6fa260e99064c2e22/libs/community/langchain_community/document_loaders/recursive_url_loader.py#L51-L51
Resolved in https://github.com/langchain-ai/langchain/pull/15559
References
- https://github.com/langchain-ai/langchain/blob/bf0b3cc0b5ade1fb95a5b1b6fa260e990...
- https://github.com/pypa/advisory-database/tree/main/vulns/langchain-exa/PYSEC-20...
- https://github.com/advisories/GHSA-h9j7-5xvc-qhg5
- https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/0xxx/CVE-2024-0243.j... Vendor Advisory
- https://nvd.nist.gov/vuln/detail/CVE-2024-0243 Vendor Advisory
- https://huntr.com/bounties/370904e7-10ac-40a4-a8d4-e2d16e1ca861 URL
- https://github.com/langchain-ai/langchain/commit/bf0b3cc0b5ade1fb95a5b1b6fa260e9... Patch
- https://github.com/langchain-ai/langchain/pull/15559 Patch
Internet-facing
60 days
Internal
At next upgrade
- Not known to be exploited
- Needs hands-on effort to exploit
- Gives an attacker partial control
Type
CWE-918Server-Side Request Forgery (SSRF)
Timeline
Published24 Feb 2024
Updated4 Nov 2026
First seen6 Mar 2026
Track software like this
Free during beta