Categories
CVE-2026-27156

Cross-Site Scripting (XSS) in nicegui (CVE-2026-27156)

Summary

Cross-site scripting in nicegui (CVE-2026-27156). Risk of unauthorized operations or information disclosure. Exploitable via nicegui.js. Mitigation: upgrade to 3.8.0 or later.

Original description

The description as published by the source.

Summary

Several NiceGUI APIs that execute methods on client-side elements (Element.run_method(), AgGrid.run_grid_method(), EChart.run_chart_method(), and others) use an eval() fallback in the JavaScript-side runMethod() function. When user-controlled input is passed as the method name, an attacker can inject arbitrary JavaScript that executes in the victim's browser.

Additionally, Element.run_method() and Element.get_computed_prop() used string interpolation instead of json.dumps() for the method/property name, allowing quote injection to break out of the intended string context.

Attack Vector

An attacker crafts a malicious URL with a payload as a query parameter. If the application passes this parameter as a method name to any of the affected APIs, the payload is sent to the client via WebSocket and executed via eval().

Example: /?method=alert(document.cookie) combined with application code like:

element.run_method(user_provided_method_name)

Impact

  • Cookie/token theft
  • DOM manipulation (phishing, fake login forms)
  • Actions performed as the victim user

Affected Methods

  1. Element.run_method()
  2. Element.get_computed_prop()
  3. AgGrid.run_grid_method()
  4. AgGrid.run_row_method()
  5. EChart.run_chart_method()
  6. JsonEditor.run_editor_method()
  7. Xterm.run_terminal_method()
  8. Leaflet.run_map_method()
  9. Leaflet.run_layer_method()
  10. LeafletLayer.run_method()

Fix

  1. Use json.dumps() for…

Source: OSV.dev (Open Source Vulnerabilities) NVD GitHub Advisory OSV

Auto-generated summary

Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.

A vulnerability tracked as CVE-2026-27156 has been found in nicegui.
Attackers can target a specific entry point like nicegui.js over the network to misuse the product.
Risk of unauthorized operations or information disclosure.
What to do: upgrade nicegui to 3.8.0 or later.
If unsure, ask your IT team or search "nicegui CVE-2026-27156" on the vendor's site.

CVE-2026-27156 (nicegui) — CWE-79
Attack vector: remote (network-reachable) / unauthenticated
Attack surface: nicegui.js
Patched: 3.8.0 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.

❓ What is the problem

Cross-site scripting (XSS) (CWE-79) exists in nicegui. Attackers reach the vulnerable code path via nicegui.js without authentication.

📍 Affected scope

Check the vendor advisory for the affected versions of nicegui. Attack surface: nicegui.js.

🔥 Severity

Severity: ?. Risk of unauthorized operations or information disclosure.

🔧 How to fix

Update to 3.8.0.

🛡️ Workaround

Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.

🔍 Detection

Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'nicegui' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.

Response actions

Concrete steps and command examples for SOC/SRE teams to execute in order

  1. 1
    Identify exposure identify
    grep -r 'nicegui' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で nicegui を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Apply patch patch
    Upgrade nicegui to 3.8.0

    ステージング環境で 3.8.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。

  3. 3
    Post-deployment verification verify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

Affected packages

PyPI nicegui
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.8.0"}]}]

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details