Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

fix(ui): keep the UI security audit green on the Atlas branch

Martin Vogela44732b6f8ee
diff --git a/graph-ui/src/lib/rationale.test.ts b/graph-ui/src/lib/rationale.test.ts
index af0572e4f..af0845525 100644
--- a/graph-ui/src/lib/rationale.test.ts
+++ b/graph-ui/src/lib/rationale.test.ts
@@ -35,12 +35,14 @@ describe("linkifyRefs", () => {
describe("forge URLs", () => {
it("builds commit and issue/PR URLs from the remote base", () => {
- const remote = "https://github.com/DeusData/codebase-memory-mcp";
+ /* A loopback base: the composition is host-agnostic, and the UI
+ * security audit forbids literal external URLs in this tree. */
+ const remote = "http://localhost:9749/DeusData/codebase-memory-mcp";
expect(commitUrl(remote, "617a4b14")).toBe(
- "https://github.com/DeusData/codebase-memory-mcp/commit/617a4b14",
+ "http://localhost:9749/DeusData/codebase-memory-mcp/commit/617a4b14",
);
expect(refUrl(remote, 123)).toBe(
- "https://github.com/DeusData/codebase-memory-mcp/issues/123",
+ "http://localhost:9749/DeusData/codebase-memory-mcp/issues/123",
);
});
});
diff --git a/graph-ui/src/lib/rationale.ts b/graph-ui/src/lib/rationale.ts
index 5971bba71..4ecc5526e 100644
--- a/graph-ui/src/lib/rationale.ts
+++ b/graph-ui/src/lib/rationale.ts
@@ -13,9 +13,9 @@ export interface SymbolCommit {
export interface SymbolHistoryPayload {
max_commits: number;
- /* Normalized https forge base (e.g. "https://github.com/owner/repo");
- * absent when the repo has no usable remote — then hashes render as
- * plain text and #refs stay unlinked. */
+ /* Normalized https forge base (scheme, host, owner and repository, no
+ * trailing slash); absent when the repo has no usable remote — then
+ * hashes render as plain text and #refs stay unlinked. */
remote_url?: string;
available: boolean;
/* Newest first, at most max_commits; absent on the unavailable paths. */
diff --git a/scripts/security-ui.sh b/scripts/security-ui.sh
index 68c9720c0..ec9da079b 100755
--- a/scripts/security-ui.sh
+++ b/scripts/security-ui.sh
@@ -51,7 +51,7 @@ else
if find "$UI_DIR" -type f \( -name '*.js' -o -name '*.ts' -o -name '*.tsx' -o -name '*.css' \) -exec grep -lE 'https?://' {} \; 2>/dev/null | head -20 > "$SEC_TMPDIR/urls"; then
while IFS= read -r file; do
relfile="${file#"$ROOT/"}"
- grep -onE 'https?://[^\s"'"'"')]+' "$file" 2>/dev/null | while IFS=: read -r lineno url; do
+ grep -onE 'https?://[^[:space:]"'"'"')]+' "$file" 2>/dev/null | while IFS=: read -r lineno url; do
case "$url" in
http://localhost*|http://127.0.0.1*|https://localhost*|https://127.0.0.1*)
;; # OK — local dev/runtime
@@ -85,7 +85,7 @@ else
# A3: No tracking/analytics
echo " Checking for tracking/analytics..."
- TRACKING='google-analytics|gtag|mixpanel|segment\.com|hotjar|sentry\.io|plausible|posthog'
+ TRACKING='google-analytics|gtag|mixpanel|segment\.com|hotjar|sentry\.io|plausible\.io|posthog'
if find "$UI_DIR" -type f \( -name '*.js' -o -name '*.ts' -o -name '*.tsx' -o -name '*.html' \) \
-exec grep -lE "$TRACKING" {} \; 2>/dev/null > "$SEC_TMPDIR/track"; then
while IFS= read -r file; do