Skip to content

SQL and r2d3 preview consent throws an uncaught GWT null dereference #18065

Open

Description

@ronblum

System details

RStudio Edition : Server (Linux); also Desktop on Windows under CI for the r2d3 case
RStudio Version : N/A
OS Version      : Ubuntu 24.04 (Server); Windows Server 2025 (r2d3 under CI)
R Version       : N/A

Steps to reproduce the problem

Using RStudio Server on Linux. These steps cover the SQL preview path; the
r2d3 preview path (below) fails the same way.

  1. Create a file injection.sql with this content:
-- !preview conn=writeLines("proof", "~/proof.txt")
SELECT 1
  1. Open injection.sql in the source editor.
  2. Run the SQL preview (the Preview button, or the "Preview SQL" command).
    • The connection expression is untrusted, so the backend declines to
      evaluate it and shows a consent dialog.
  3. Click Yes to consent.
    • The IDE throws an uncaught client exception: TypeError: Cannot read properties of null (reading 'WXc') in obfuscated GWT code.
    • The error dialog that should report the failed connection never
      renders.

For the r2d3 path, repeat with a file injection.js containing
// !preview r2d3 data={ writeLines("proof", "~/proof.txt"); c(0.3, 0.6, 0.8) }
followed by a d3 body, run the "Preview" (r2d3) command, and click Yes at the
consent dialog. On Windows under CI and on Linux Server, the IDE throws the
same null dereference (reading 'VXc' on Windows, reading 'WXc' on Linux
Server) during the widget render.

Describe the problem in detail

After the user consents to run an untrusted preview expression, the IDE
throws an uncaught GWT null dereference in compiled JS, which prevents the
follow-up UI from appearing (the error-confirmation dialog for SQL, the
rendered widget for r2d3). This occurs consistently on RStudio Server (Linux)
for both the SQL and r2d3 paths, and on Windows under CI for the r2d3 path. It
doesn't occur on macOS desktop, or on Windows desktop for the SQL path.

The obfuscated symbols differ by build (WXc on Linux Server, VXc on
Windows CI) but appear to point to the same null dereference. Decoding the
stack to a source location needs a build with PRETTY GWT symbols
(-DGWT_STYLE=PRETTY).

Describe the behavior you expected

Consenting to the preview would evaluate the expression and show the
resulting UI (the error confirmation, or the rendered widget) without
throwing an uncaught client exception.

See PR #17939, which marks the affected tests test.fixme on the platforms
above, and tracking issue #18064. The security behavior the tests cover is rstudio-pro#10981.

Note: This came out of a review of the PR, I haven't tried it yet myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions