Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review (codex): redact UNC hosts

[._.]/ Adam Eivy81891c53c89b
diff --git a/server/lib/workspaceRoots.js b/server/lib/workspaceRoots.js
index 4953255041..9d2b8d0e59 100644
--- a/server/lib/workspaceRoots.js
+++ b/server/lib/workspaceRoots.js
@@ -87,9 +87,20 @@ const singleLine = (value) => String(value).replace(/[\r\n]+/g, ' ');
const PRIVATE_HOME_SEGMENT = /(^|[\\/])((?:Users|home))[\\/][^\\/]+(?=([\\/]|$))/gi;
+const redactUncHost = (path) => {
+ const prefix = path.startsWith('\\\\') ? '\\\\' : path.startsWith('//') ? '//' : null;
+ if (!prefix) return path;
+ const hostEndOffset = path.slice(prefix.length).search(/[\\/]/);
+ if (hostEndOffset < 0) return `${prefix}<host>`;
+ const hostEnd = prefix.length + hostEndOffset;
+ return `${prefix}<host>${path.slice(hostEnd)}`;
+};
+
const formatLogPath = (value) => {
const path = singleLine(value);
if (path === HOME_ROOT) return '~';
+ const redactedUncPath = redactUncHost(path);
+ if (redactedUncPath !== path) return redactedUncPath;
const relativeHomePath = relative(HOME_ROOT, path);
if (relativeHomePath && !relativeHomePath.startsWith('..') && !isAbsolute(relativeHomePath)) {
return `~/${relativeHomePath}`;
diff --git a/server/lib/workspaceRoots.test.js b/server/lib/workspaceRoots.test.js
index 4c4d330bea..868b71466c 100644
--- a/server/lib/workspaceRoots.test.js
+++ b/server/lib/workspaceRoots.test.js
@@ -68,6 +68,13 @@ describe('outsideAllowedRootsMessage', () => {
expect(message).toContain('/home/<user>/private-repo');
expect(message).not.toContain('alice');
});
+
+ it('redacts hosts in UNC paths', () => {
+ const message = outsideAllowedRootsMessage(String.raw`\\server\share\repo`);
+
+ expect(message).toContain(String.raw`\\<host>\share\repo`);
+ expect(message).not.toContain('server');
+ });
});
// Windows repos routinely live off the system drive (D:\code, E:\projects), and