From 1f52fe2f842156428fffbdad5edc9dcf0a9e877c Mon Sep 17 00:00:00 2001
From: "google-labs-jules[bot]"
<161369871+google-labs-jules[bot]@users.noreply.github.com>
Date: Sun, 5 Apr 2026 07:52:11 +0000
Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=9B=A1=EF=B8=8F=20Sentinel:=20[MEDIUM?=
=?UTF-8?q?]=20Fix=20potential=20XSS=20in=20Health=20Check=20page?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Refactored the Health Check page to remove the use of `dangerouslySetInnerHTML`.
System metadata for version and websocket checks is now rendered using
safe React JSX fragments instead of raw HTML strings. Added rel="noreferrer"
to external links for improved security.
Severity: MEDIUM
Vulnerability: Potential XSS via dangerouslySetInnerHTML.
Impact: Possible script execution if metadata is compromised.
Fix: Use React nodes for dynamic content rendering.
Verification: ESLint and tsc passed; manual verification of the file content.
Co-authored-by: AGI-Corporation <186229839+AGI-Corporation@users.noreply.github.com>
---
.jules/sentinel.md | 4 ++
.../routes/platform/infra/health/index.tsx | 57 ++++++++++++++-----
2 files changed, 47 insertions(+), 14 deletions(-)
create mode 100644 .jules/sentinel.md
diff --git a/.jules/sentinel.md b/.jules/sentinel.md
new file mode 100644
index 0000000000..ca9194ebd3
--- /dev/null
+++ b/.jules/sentinel.md
@@ -0,0 +1,4 @@
+## 2025-05-15 - [XSS mitigation in Health Check]
+**Vulnerability:** Use of `dangerouslySetInnerHTML` for rendering health check details.
+**Learning:** System metadata (like version numbers) were being formatted as HTML strings and rendered using `dangerouslySetInnerHTML`. While seemingly low risk, this creates an XSS vector if any part of the metadata string can be influenced by an attacker or if the sanitization is missing.
+**Prevention:** Always prefer rendering dynamic content as React nodes or JSX fragments over string-based HTML. This allows React's built-in escaping to protect the application from XSS.
diff --git a/packages/react-ui/src/app/routes/platform/infra/health/index.tsx b/packages/react-ui/src/app/routes/platform/infra/health/index.tsx
index 75cfbe6d35..ad4bb1c598 100644
--- a/packages/react-ui/src/app/routes/platform/infra/health/index.tsx
+++ b/packages/react-ui/src/app/routes/platform/infra/health/index.tsx
@@ -39,13 +39,30 @@ export default function WorkersPage() {
type: isVersionUpToDate ? STATUS.SUCCESS : STATUS.FAULT,
message: isVersionUpToDate ? 'Up to date' : 'Update available',
},
- details: `Current: ${
- currentVersion || 'Unknown'
- }\nLatest: ${latestVersion || 'Unknown'}\n${
- !isVersionUpToDate
- ? 'Upgrade now to enjoy the latest features and bug fixes.\nCheck the changelog releases.'
- : ''
- }`,
+ details: (
+ <>
+ Current: {currentVersion || 'Unknown'}
+
+ Latest: {latestVersion || 'Unknown'}
+ {!isVersionUpToDate && (
+ <>
+
+ Upgrade now to enjoy the latest features and bug fixes.
+
+ Check the changelog{' '}
+
+ releases
+
+ .
+ >
+ )}
+ >
+ ),
faultIcon:
Visit the troubleshooting guide for more details.',
+ details: socket.connected ? (
+ t('No issues detected')
+ ) : (
+ <>
+ Connection issues detected.
+
+ Visit the{' '}
+
+ troubleshooting guide
+ {' '}
+ for more details.
+ >
+ ),
faultIcon: