Skip to content

web: Fix unsafe HTTP script loading in Web GUI - #11183

Open
jorge-ferreira-pii wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:fix-WebGUI-local-assets-squashed
Open

web: Fix unsafe HTTP script loading in Web GUI#11183
jorge-ferreira-pii wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:fix-WebGUI-local-assets-squashed

Conversation

@jorge-ferreira-pii

Copy link
Copy Markdown
Contributor

Fixes #11065

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request vendors several third-party browser libraries (leaflet, golden-layout, three, elkjs, netlistsvg) to ensure the web viewer and saved reports can run completely offline without fetching code from CDNs. It introduces an asset-locking script, updates both Bazel and CMake build systems to embed these assets, and implements C++ logic to inline stylesheets and images as data URIs into saved reports. The review feedback highlights two important improvements: first, using generic_string() instead of string() in resolveAssetPath to prevent path resolution failures on Windows due to backslash separators; second, using the noexcept overload of std::filesystem::remove with std::error_code to avoid potential crashes from thrown exceptions.

Comment thread src/web/src/web.cpp Outdated
Comment thread src/web/src/web.cpp Outdated
@jorge-ferreira-pii
jorge-ferreira-pii marked this pull request as ready for review August 19, 2026 19:59
@jorge-ferreira-pii
jorge-ferreira-pii requested a review from a team as a code owner August 19, 2026 19:59
@jorge-ferreira-pii jorge-ferreira-pii changed the title web: serve the browser libraries from the binary instead of CDNs web: Fix unsafe HTTP script loading in Web GUI Aug 19, 2026
@maliberty

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: fedd4f70f6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

The viewer and the saved report loaded leaflet, golden-layout, three, elkjs
and netlistsvg from CDNs, one of them over plain http (issue The-OpenROAD-Project#11065).  They
are vendored under src/web/third-party, embedded in the binary and served by
web_server, so nothing is downloaded at build time or at run time.

Signed-off-by: Jorge Ferreira <jorge.ferreira@precisioninno.com>
WEB-0044 and WEB-0045 collided with saveDisplayControls, which landed while this
branch was out, so they move to 77 and 78.  TestCssInliner pulls in web.cpp and
needs the headless gui stub under CMake, as its Bazel twin already declares.

Signed-off-by: Jorge Ferreira <jorge.ferreira@precisioninno.com>
@openroad-ci
openroad-ci force-pushed the fix-WebGUI-local-assets-squashed branch from fedd4f7 to a55212f Compare August 25, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

web: Attempt to load scripts over unsafe http

2 participants