Skip to content

IR viz Flask app ships with debug mode enabled and binds to all interfaces (0.0.0.0), exposing the Werkzeug interactive debugger on errors. #4200

@tikipiya

Description

@tikipiya

Summary

The XLS IR visualization web app (xls/visualization/ir_viz/app.py) enables Flask’s development/debug mode unconditionally and listens on all network interfaces. Any unhandled exception while handling a request is therefore answered with the Werkzeug interactive debugger HTML (not a generic 500 page), which is intended for trusted local development only.

Evidence in code

  • After creating the Flask app, webapp.debug is set to True with no environment-based override in this module.
  • webapp.run(...) is called with host='0.0.0.0' (IPv4) or '::' (IPv6) and a user-chosen port, and without passing debug=False or use_debugger=False, so Flask’s defaults apply: use_debugger follows app.debug (see Flask Flask.run implementation).

Runtime behavior (verified pattern)

With app.debug = True and app.run(...) omitting debug, a route that raises returns HTTP 500 whose body includes the Werkzeug Debugger UI (e.g. __debugger__ resources, EVALEX enabled in the page). The same mechanism applies to this app whenever an exception propagates from a view/handler.

Affected component

  • File: xls/visualization/ir_viz/app.py
  • Entry: main()webapp.run(...)

Preconditions

An attacker must be able to reach the bound TCP port (e.g. same LAN/VPN, misbound container port, or user who mistakenly exposes the tool). Triggering an exception may be as simple as malformed input or dependency/tooling errors on specific endpoints (e.g. subprocess failures when invoking bundled binaries).

Who can exploit it: Any network client that can open a TCP connection to the listening address (0.0.0.0 / :: on the chosen port) while the IR visualization server is running—without authentication, because the app does not implement access control for those debug artifacts.

What they gain:

  • Confidentiality: Detailed tracebacks and local paths/source context in the debugger page can leak implementation details, file layout, versions, and sometimes sensitive data present in stack frames.
  • Integrity / availability: The interactive debugger is designed for arbitrary Python evaluation in the server process (PIN-gated in Werkzeug, but still inappropriate on an exposed interface). Successful misuse yields remote code execution in the same privilege context as the server process.
  • Misconfiguration amplification: Binding to all interfaces makes accidental exposure (e.g. laptop on coffee-shop Wi‑Fi, cloud VM with security group left open) much more likely than 127.0.0.1 alone.

Severity note: Risk is highest when users run this tool on a shared or routable network believing it is a “local viewer,” because the combination debug + 0.0.0.0 turns routine errors into a publicly reachable debugging surface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions