Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

security: harden remote bridge, path-jail file ops, SSRF, CSP

purple3d2bd3a706fc
diff --git a/package-lock.json b/package-lock.json
index 4a097d8a..0b0295ed 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "locally-uncensored",
- "version": "2.5.0",
+ "version": "2.5.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "locally-uncensored",
- "version": "2.5.0",
+ "version": "2.5.4",
"license": "AGPL-3.0",
"dependencies": {
"@react-three/drei": "^10.7.7",
@@ -57,13 +57,13 @@
}
},
"node_modules/@babel/code-frame": {
- "version": "7.29.0",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz",
- "integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==",
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz",
+ "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@babel/helper-validator-identifier": "^7.28.5",
+ "@babel/helper-validator-identifier": "^7.29.7",
"js-tokens": "^4.0.0",
"picocolors": "^1.1.1"
},
@@ -72,9 +72,9 @@
}
},
"node_modules/@babel/compat-data": {
- "version": "7.29.0",
- "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.0.tgz",
- "integrity": "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==",
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz",
+ "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==",
"dev": true,
"license": "MIT",
"engines": {
@@ -82,21 +82,21 @@
}
},
"node_modules/@babel/core": {
- "version": "7.29.0",
- "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz",
- "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==",
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz",
+ "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@babel/code-frame": "^7.29.0",
- "@babel/generator": "^7.29.0",
- "@babel/helper-compilation-targets": "^7.28.6",
- "@babel/helper-module-transforms": "^7.28.6",
- "@babel/helpers": "^7.28.6",
- "@babel/parser": "^7.29.0",
- "@babel/template": "^7.28.6",
- "@babel/traverse": "^7.29.0",
- "@babel/types": "^7.29.0",
+ "@babel/code-frame": "^7.29.7",
+ "@babel/generator": "^7.29.7",
+ "@babel/helper-compilation-targets": "^7.29.7",
+ "@babel/helper-module-transforms": "^7.29.7",
+ "@babel/helpers": "^7.29.7",
+ "@babel/parser": "^7.29.7",
+ "@babel/template": "^7.29.7",
+ "@babel/traverse": "^7.29.7",
+ "@babel/types": "^7.29.7",
"@jridgewell/remapping": "^2.3.5",
"convert-source-map": "^2.0.0",
"debug": "^4.1.0",
@@ -113,14 +113,14 @@
}
},
"node_modules/@babel/generator": {
- "version": "7.29.1",
- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.1.tgz",
- "integrity": "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==",
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz",
+ "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@babel/parser": "^7.29.0",
- "@babel/types": "^7.29.0",
+ "@babel/parser": "^7.29.7",
+ "@babel/types": "^7.29.7",
"@jridgewell/gen-mapping": "^0.3.12",
"@jridgewell/trace-mapping": "^0.3.28",
"jsesc": "^3.0.2"
@@ -130,14 +130,14 @@
}
},
"node_modules/@babel/helper-compilation-targets": {
- "version": "7.28.6",
- "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz",
- "integrity": "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==",
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz",
+ "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@babel/compat-data": "^7.28.6",
- "@babel/helper-validator-option": "^7.27.1",
+ "@babel/compat-data": "^7.29.7",
+ "@babel/helper-validator-option": "^7.29.7",
"browserslist": "^4.24.0",
"lru-cache": "^5.1.1",
"semver": "^6.3.1"
@@ -147,9 +147,9 @@
}
},
"node_modules/@babel/helper-globals": {
- "version": "7.28.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz",
- "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==",
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz",
+ "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==",
"dev": true,
"license": "MIT",
"engines": {
@@ -157,29 +157,29 @@
}
},
"node_modules/@babel/helper-module-imports": {
- "version": "7.28.6",
- "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz",
- "integrity": "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==",
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz",
+ "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@babel/traverse": "^7.28.6",
- "@babel/types": "^7.28.6"
+ "@babel/traverse": "^7.29.7",
+ "@babel/types": "^7.29.7"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-module-transforms": {
- "version": "7.28.6",
- "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz",
- "integrity": "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==",
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz",
+ "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@babel/helper-module-imports": "^7.28.6",
- "@babel/helper-validator-identifier": "^7.28.5",
- "@babel/traverse": "^7.28.6"
+ "@babel/helper-module-imports": "^7.29.7",
+ "@babel/helper-validator-identifier": "^7.29.7",
+ "@babel/traverse": "^7.29.7"
},
"engines": {
"node": ">=6.9.0"
@@ -189,9 +189,9 @@
}
},
"node_modules/@babel/helper-string-parser": {
- "version": "7.27.1",
- "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz",
- "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==",
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz",
+ "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==",
"dev": true,
"license": "MIT",
"engines": {
@@ -199,9 +199,9 @@
}
},
"node_modules/@babel/helper-validator-identifier": {
- "version": "7.28.5",
- "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz",
- "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==",
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz",
+ "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==",
"dev": true,
"license": "MIT",
"engines": {
@@ -209,9 +209,9 @@
}
},
"node_modules/@babel/helper-validator-option": {
- "version": "7.27.1",
- "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz",
- "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==",
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz",
+ "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==",
"dev": true,
"license": "MIT",
"engines": {
@@ -219,27 +219,27 @@
}
},
"node_modules/@babel/helpers": {
- "version": "7.29.2",
- "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.2.tgz",
- "integrity": "sha512-HoGuUs4sCZNezVEKdVcwqmZN8GoHirLUcLaYVNBK2J0DadGtdcqgr3BCbvH8+XUo4NGjNl3VOtSjEKNzqfFgKw==",
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz",
+ "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@babel/template": "^7.28.6",
- "@babel/types": "^7.29.0"
+ "@babel/template": "^7.29.7",
+ "@babel/types": "^7.29.7"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/parser": {
- "version": "7.29.2",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.2.tgz",
- "integrity": "sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==",
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz",
+ "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@babel/types": "^7.29.0"
+ "@babel/types": "^7.29.7"
},
"bin": {
"parser": "bin/babel-parser.js"
@@ -258,33 +258,33 @@
}
},
"node_modules/@babel/template": {
- "version": "7.28.6",
- "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.28.6.tgz",
- "integrity": "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==",
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz",
+ "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@babel/code-frame": "^7.28.6",
- "@babel/parser": "^7.28.6",
- "@babel/types": "^7.28.6"
+ "@babel/code-frame": "^7.29.7",
+ "@babel/parser": "^7.29.7",
+ "@babel/types": "^7.29.7"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/traverse": {
- "version": "7.29.0",
- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.0.tgz",
- "integrity": "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==",
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz",
+ "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@babel/code-frame": "^7.29.0",
- "@babel/generator": "^7.29.0",
- "@babel/helper-globals": "^7.28.0",
- "@babel/parser": "^7.29.0",
- "@babel/template": "^7.28.6",
- "@babel/types": "^7.29.0",
+ "@babel/code-frame": "^7.29.7",
+ "@babel/generator": "^7.29.7",
+ "@babel/helper-globals": "^7.29.7",
+ "@babel/parser": "^7.29.7",
+ "@babel/template": "^7.29.7",
+ "@babel/types": "^7.29.7",
"debug": "^4.3.1"
},
"engines": {
@@ -292,14 +292,14 @@
}
},
"node_modules/@babel/types": {
- "version": "7.29.0",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz",
- "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==",
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz",
+ "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@babel/helper-string-parser": "^7.27.1",
- "@babel/helper-validator-identifier": "^7.28.5"
+ "@babel/helper-string-parser": "^7.29.7",
+ "@babel/helper-validator-identifier": "^7.29.7"
},
"engines": {
"node": ">=6.9.0"
@@ -312,9 +312,9 @@
"license": "Apache-2.0"
},
"node_modules/@emnapi/core": {
- "version": "1.9.2",
- "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.9.2.tgz",
- "integrity": "sha512-UC+ZhH3XtczQYfOlu3lNEkdW/p4dsJ1r/bP7H8+rhao3TTTMO1ATq/4DdIi23XuGoFY+Cz0JmCbdVl0hz9jZcA==",
+ "version": "1.10.0",
+ "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz",
+ "integrity": "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==",
"license": "MIT",
"optional": true,
"dependencies": {
@@ -323,9 +323,9 @@
}
},
"node_modules/@emnapi/runtime": {
- "version": "1.9.2",
- "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.2.tgz",
- "integrity": "sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw==",
+ "version": "1.10.0",
+ "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz",
+ "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==",
"license": "MIT",
"optional": true,
"dependencies": {
@@ -865,13 +865,13 @@
}
},
"node_modules/@napi-rs/wasm-runtime": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.3.tgz",
- "integrity": "sha512-xK9sGVbJWYb08+mTJt3/YV24WxvxpXcXtP6B172paPZ+Ts69Re9dAr7lKwJoeIx8OoeuimEiRZ7umkiUVClmmQ==",
+ "version": "1.1.5",
+ "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.5.tgz",
+ "integrity": "sha512-AWPoBRJ9tsnVhor4sjO7rkni+7p+2IAEFj6cx06UgP10jkQHqay/36uRV/bFkgrh18D9vb4cr8Q0Pthskgzy+Q==",
"license": "MIT",
"optional": true,
"dependencies": {
- "@tybys/wasm-util": "^0.10.1"
+ "@tybys/wasm-util": "^0.10.2"
},
"funding": {
"type": "github",
@@ -883,9 +883,9 @@
}
},
"node_modules/@oxc-project/types": {
- "version": "0.124.0",
- "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.124.0.tgz",
- "integrity": "sha512-VBFWMTBvHxS11Z5Lvlr3IWgrwhMTXV+Md+EQF0Xf60+wAdsGFTBx7X7K/hP4pi8N7dcm1RvcHwDxZ16Qx8keUg==",
+ "version": "0.133.0",
+ "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.133.0.tgz",
+ "integrity": "sha512-KzkdCd6Uxqnf6l3HOw1xfatAlUURA0g14cvBYFyJ5SaNOQbOUvBr9PKArcPcrNIeRsBdgcUzOGrhKveVpvOIGA==",
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/Boshen"
@@ -980,9 +980,9 @@
}
},
"node_modules/@rolldown/binding-android-arm64": {
- "version": "1.0.0-rc.15",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.0-rc.15.tgz",
- "integrity": "sha512-YYe6aWruPZDtHNpwu7+qAHEMbQ/yRl6atqb/AhznLTnD3UY99Q1jE7ihLSahNWkF4EqRPVC4SiR4O0UkLK02tA==",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.3.tgz",
+ "integrity": "sha512-454rs7jHngixp/NMxd5srYD57OnzSlZ/eFTETjORQHLwJG1lRtmNOJcBerZlfu4GjKqeq8aCCIQrMdHyhI51Hw==",
"cpu": [
"arm64"
],
@@ -996,9 +996,9 @@
}
},
"node_modules/@rolldown/binding-darwin-arm64": {
- "version": "1.0.0-rc.15",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.0-rc.15.tgz",
- "integrity": "sha512-oArR/ig8wNTPYsXL+Mzhs0oxhxfuHRfG7Ikw7jXsw8mYOtk71W0OkF2VEVh699pdmzjPQsTjlD1JIOoHkLP1Fg==",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.3.tgz",
+ "integrity": "sha512-PcAhP+ynjURNyy8SKGl5DQP94aGuB/7JrXJb/t7P+hanXvQVMWzUvRRhBAcg/lNRadBhoUPqSoP4xw5tR/KBEA==",
"cpu": [
"arm64"
],
@@ -1012,9 +1012,9 @@
}
},
"node_modules/@rolldown/binding-darwin-x64": {
- "version": "1.0.0-rc.15",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.0-rc.15.tgz",
- "integrity": "sha512-YzeVqOqjPYvUbJSWJ4EDL8ahbmsIXQpgL3JVipmN+MX0XnXMeWomLN3Fb+nwCmP/jfyqte5I3XRSm7OfQrbyxw==",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.3.tgz",
+ "integrity": "sha512-9YpfeUvSE2RS7wysJ81uOZkXJz7f7Q55H2Gvp3VEw/EsahqDtrphrZ0EwDLK5vvKOzaCrBsjF8JmnMLcUt78Gg==",
"cpu": [
"x64"
],
@@ -1028,9 +1028,9 @@
}
},
"node_modules/@rolldown/binding-freebsd-x64": {
- "version": "1.0.0-rc.15",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.0-rc.15.tgz",
- "integrity": "sha512-9Erhx956jeQ0nNTyif1+QWAXDRD38ZNjr//bSHrt6wDwB+QkAfl2q6Mn1k6OBPerznjRmbM10lgRb1Pli4xZPw==",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.3.tgz",
+ "integrity": "sha512-yB1IlAsSNHncV6SCTL27/MVGR5htvQsoGxIv5KMGXALp+Ll1wYsn+x98M9MW7qa+NdSbvrrY7ANI4wLJ0n1e6g==",
"cpu": [
"x64"
],
@@ -1044,9 +1044,9 @@
}
},
"node_modules/@rolldown/binding-linux-arm-gnueabihf": {
- "version": "1.0.0-rc.15",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.0-rc.15.tgz",
- "integrity": "sha512-cVwk0w8QbZJGTnP/AHQBs5yNwmpgGYStL88t4UIaqcvYJWBfS0s3oqVLZPwsPU6M0zlW4GqjP0Zq5MnAGwFeGA==",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.3.tgz",
+ "integrity": "sha512-Yi30IVAAfLUCy2MseFjbB1jAMDl1VMCAas5StnYp8da9+CKvMd2H2cbEjWcw5NPaPqzvYkVIaF1nNUG+b7u/sw==",
"cpu": [
"arm"
],
@@ -1060,9 +1060,9 @@
}
},
"node_modules/@rolldown/binding-linux-arm64-gnu": {
- "version": "1.0.0-rc.15",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.0-rc.15.tgz",
- "integrity": "sha512-eBZ/u8iAK9SoHGanqe/jrPnY0JvBN6iXbVOsbO38mbz+ZJsaobExAm1Iu+rxa4S1l2FjG0qEZn4Rc6X8n+9M+w==",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.3.tgz",
+ "integrity": "sha512-jsO7R8To+AdlYgUmN5sHSCZbfhtMBkO0WUx8iORQnPcMMdgr7qM2DQmMwgabs3GhNztdmoKkMKQFHD6DTMCIQw==",
"cpu": [
"arm64"
],
@@ -1076,9 +1076,9 @@
}
},
"node_modules/@rolldown/binding-linux-arm64-musl": {
- "version": "1.0.0-rc.15",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.0-rc.15.tgz",
- "integrity": "sha512-ZvRYMGrAklV9PEkgt4LQM6MjQX2P58HPAuecwYObY2DhS2t35R0I810bKi0wmaYORt6m/2Sm+Z+nFgb0WhXNcQ==",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.3.tgz",
+ "integrity": "sha512-VWkUHwWriDciit80wleYwKILoR/KMvxh/IdwS/paX+ZgpuRpCrKLUdadJbc0NpBEiyhpYawsJ73j9aCvOH+f7Q==",
"cpu": [
"arm64"
],
@@ -1092,9 +1092,9 @@
}
},
"node_modules/@rolldown/binding-linux-ppc64-gnu": {
- "version": "1.0.0-rc.15",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.0-rc.15.tgz",
- "integrity": "sha512-VDpgGBzgfg5hLg+uBpCLoFG5kVvEyafmfxGUV0UHLcL5irxAK7PKNeC2MwClgk6ZAiNhmo9FLhRYgvMmedLtnQ==",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.3.tgz",
+ "integrity": "sha512-5f1laC0SlIR0yDbFCd8acUhvJIag6N3zC5P7oUPN6wX0aOma+uKJ0wBDH5aq7I1PVI2ttTlhJwzwRIBnLiSGEg==",
"cpu": [
"ppc64"
],
@@ -1108,9 +1108,9 @@
}
},
"node_modules/@rolldown/binding-linux-s390x-gnu": {
- "version": "1.0.0-rc.15",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.0-rc.15.tgz",
- "integrity": "sha512-y1uXY3qQWCzcPgRJATPSOUP4tCemh4uBdY7e3EZbVwCJTY3gLJWnQABgeUetvED+bt1FQ01OeZwvhLS2bpNrAQ==",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.3.tgz",
+ "integrity": "sha512-Iq4ko0r4XsgbrF/LunNgHtAGLRRVE2kXonAXQ/MV0mC6jQpMOhW1SvtZja2EhC/kd05++bP78dsqBeIQyYJ6Yg==",
"cpu": [
"s390x"
],
@@ -1124,9 +1124,9 @@
}
},
"node_modules/@rolldown/binding-linux-x64-gnu": {
- "version": "1.0.0-rc.15",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.0-rc.15.tgz",
- "integrity": "sha512-023bTPBod7J3Y/4fzAN6QtpkSABR0rigtrwaP+qSEabUh5zf6ELr9Nc7GujaROuPY3uwdSIXWrvhn1KxOvurWA==",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.3.tgz",
+ "integrity": "sha512-B8m6tD5+/N5FeNQFbKlLA/2yVq9ycQP1SeedyEYYKWBNR3ZQbkvIUcNnDNM03lO1l5F2roiiFJGgvoLLyZXtSg==",
"cpu": [
"x64"
],
@@ -1140,9 +1140,9 @@
}
},
"node_modules/@rolldown/binding-linux-x64-musl": {
- "version": "1.0.0-rc.15",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.0-rc.15.tgz",
- "integrity": "sha512-witB2O0/hU4CgfOOKUoeFgQ4GktPi1eEbAhaLAIpgD6+ZnhcPkUtPsoKKHRzmOoWPZue46IThdSgdo4XneOLYw==",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.3.tgz",
+ "integrity": "sha512-pSdpdUJHkuCxun9LE7jvgUB9qsRgaiyNNCX7m/AvHTcq67AiT/Yhoxvw5zPfhrM8k/BfP8ce/hMOpthKDpEUow==",
"cpu": [
"x64"
],
@@ -1156,9 +1156,9 @@
}
},
"node_modules/@rolldown/binding-openharmony-arm64": {
- "version": "1.0.0-rc.15",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.0-rc.15.tgz",
- "integrity": "sha512-UCL68NJ0Ud5zRipXZE9dF5PmirzJE4E4BCIOOssEnM7wLDsxjc6Qb0sGDxTNRTP53I6MZpygyCpY8Aa8sPfKPg==",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.3.tgz",
+ "integrity": "sha512-OXXS3RKJgX2uLwM+gYyuH5omcH8fL1LJs96pZGgtetVCahON57+d4SJHzTgZiOjxgGkSnpXpOsWuPDGAKAigEg==",
"cpu": [
"arm64"
],
@@ -1172,27 +1172,27 @@
}
},
"node_modules/@rolldown/binding-wasm32-wasi": {
- "version": "1.0.0-rc.15",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.0-rc.15.tgz",
- "integrity": "sha512-ApLruZq/ig+nhaE7OJm4lDjayUnOHVUa77zGeqnqZ9pn0ovdVbbNPerVibLXDmWeUZXjIYIT8V3xkT58Rm9u5Q==",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.3.tgz",
+ "integrity": "sha512-JTtb8BWFynicNSoPrehsCzBtOKjZ6jhMiPFEmOiuXg1Fl8dn2KHQob+GuPSGR0dryQa1PQJbzjF3dqO/whhjLg==",
"cpu": [
"wasm32"
],
"license": "MIT",
"optional": true,
"dependencies": {
- "@emnapi/core": "1.9.2",
- "@emnapi/runtime": "1.9.2",
- "@napi-rs/wasm-runtime": "^1.1.3"
+ "@emnapi/core": "1.10.0",
+ "@emnapi/runtime": "1.10.0",
+ "@napi-rs/wasm-runtime": "^1.1.4"
},
"engines": {
- "node": ">=14.0.0"
+ "node": "^20.19.0 || >=22.12.0"
}
},
"node_modules/@rolldown/binding-win32-arm64-msvc": {
- "version": "1.0.0-rc.15",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.0-rc.15.tgz",
- "integrity": "sha512-KmoUoU7HnN+Si5YWJigfTws1jz1bKBYDQKdbLspz0UaqjjFkddHsqorgiW1mxcAj88lYUE6NC/zJNwT+SloqtA==",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.3.tgz",
+ "integrity": "sha512-gEdFFEN70A/jxb2svrWsN3aDL7OUtmvlOy+6fa2jxG8K0wQ1ZbdeLGnidov6Yu5/733dI5ySfzFlQ/cb0bSz1g==",
"cpu": [
"arm64"
],
@@ -1206,9 +1206,9 @@
}
},
"node_modules/@rolldown/binding-win32-x64-msvc": {
- "version": "1.0.0-rc.15",
- "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.0-rc.15.tgz",
- "integrity": "sha512-3P2A8L+x75qavWLe/Dll3EYBJLQmtkJN8rfh+U/eR3MqMgL/h98PhYI+JFfXuDPgPeCB7iZAKiqii5vqOvnA0g==",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.3.tgz",
+ "integrity": "sha512-eXB7CHuaQdqmJcc3koCNtNPmT/bj2gc999kUFgBxG8Ac0NdgXc4rkCHhqrgrhN3zddvvvrgzj1e90SuSfmyIXA==",
"cpu": [
"x64"
],
@@ -1744,9 +1744,9 @@
"license": "MIT"
},
"node_modules/@tybys/wasm-util": {
- "version": "0.10.1",
- "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz",
- "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==",
+ "version": "0.10.2",
+ "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.2.tgz",
+ "integrity": "sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==",
"license": "MIT",
"optional": true,
"dependencies": {
@@ -2135,9 +2135,9 @@
}
},
"node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
- "version": "5.0.5",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz",
- "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==",
+ "version": "5.0.6",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz",
+ "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -2401,9 +2401,9 @@
"license": "BSD-3-Clause"
},
"node_modules/@xmldom/xmldom": {
- "version": "0.8.12",
- "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.12.tgz",
- "integrity": "sha512-9k/gHF6n/pAi/9tqr3m3aqkuiNosYTurLLUtc7xQ9sxB/wm7WPygCv8GYa6mS0fLJEHhqMC1ATYhz++U/lRHqg==",
+ "version": "0.8.13",
+ "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.13.tgz",
+ "integrity": "sha512-KRYzxepc14G/CEpEGc3Yn+JKaAeT63smlDr+vjB8jRfgTBBI9wRj/nkQEO+ucV8p8I9bfKLWp37uHgFrbntPvw==",
"license": "MIT",
"engines": {
"node": ">=10.0.0"
@@ -2520,9 +2520,9 @@
"license": "MIT"
},
"node_modules/baseline-browser-mapping": {
- "version": "2.10.10",
- "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.10.tgz",
- "integrity": "sha512-sUoJ3IMxx4AyRqO4MLeHlnGDkyXRoUG0/AI9fjK+vS72ekpV0yWVY7O0BVjmBcRtkNcsAO2QDZ4tdKKGoI6YaQ==",
+ "version": "2.10.38",
+ "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.38.tgz",
+ "integrity": "sha512-31/02mVB4yuQU6adKk5SlY6m+mxDwUq5KZkyYgnLrrKl7TEm1+3PyDtDBz2kOv/wxZz41GHsvV1A/u6RmiyBvw==",
"dev": true,
"license": "Apache-2.0",
"bin": {
@@ -2559,9 +2559,9 @@
}
},
"node_modules/browserslist": {
- "version": "4.28.1",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz",
- "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==",
+ "version": "4.28.2",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.2.tgz",
+ "integrity": "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==",
"dev": true,
"funding": [
{
@@ -2579,11 +2579,11 @@
],
"license": "MIT",
"dependencies": {
- "baseline-browser-mapping": "^2.9.0",
- "caniuse-lite": "^1.0.30001759",
- "electron-to-chromium": "^1.5.263",
- "node-releases": "^2.0.27",
- "update-browserslist-db": "^1.2.0"
+ "baseline-browser-mapping": "^2.10.12",
+ "caniuse-lite": "^1.0.30001782",
+ "electron-to-chromium": "^1.5.328",
+ "node-releases": "^2.0.36",
+ "update-browserslist-db": "^1.2.3"
},
"bin": {
"browserslist": "cli.js"
@@ -2640,9 +2640,9 @@
}
},
"node_modules/caniuse-lite": {
- "version": "1.0.30001781",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001781.tgz",
- "integrity": "sha512-RdwNCyMsNBftLjW6w01z8bKEvT6e/5tpPVEgtn22TiLGlstHOVecsX2KHFkD5e/vRnIE4EGzpuIODb3mtswtkw==",
+ "version": "1.0.30001799",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001799.tgz",
+ "integrity": "sha512-hG1bReV+OUU+MOqK4t/ZWI0tZOyz3rqS9XuhOUz1cIcbwBKjOyJEJuw9ER5JuNyqxNk8u/JUVbGibBOL1yrjFw==",
"dev": true,
"funding": [
{
@@ -2945,9 +2945,9 @@
}
},
"node_modules/electron-to-chromium": {
- "version": "1.5.322",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.322.tgz",
- "integrity": "sha512-vFU34OcrvMcH66T+dYC3G4nURmgfDVewMIu6Q2urXpumAPSMmzvcn04KVVV8Opikq8Vs5nUbO/8laNhNRqSzYw==",
+ "version": "1.5.376",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.376.tgz",
+ "integrity": "sha512-cUVA7/RvbFTEuw/i3obUwDTRIXojaxkResf+ibByPFxjc6XK3VNtcQXV0NSbAlJ0FMjcJGgftVVB4Qo184EXvA==",
"dev": true,
"license": "ISC"
},
@@ -3858,10 +3858,20 @@
"license": "MIT"
},
"node_modules/js-yaml": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
- "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz",
+ "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==",
"dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/puzrin"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/nodeca"
+ }
+ ],
"license": "MIT",
"dependencies": {
"argparse": "^2.0.1"
@@ -5315,9 +5325,9 @@
"license": "MIT"
},
"node_modules/nanoid": {
- "version": "3.3.11",
- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",
- "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==",
+ "version": "3.3.15",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.15.tgz",
+ "integrity": "sha512-y7Wygv/7mEOvxTuEQDB8StXdMRBWf1kR/tlhAzBRUFkB2jfcLOAxO/SHmOO2zgz1pVgK29/kyupn059/bCHdjA==",
"funding": [
{
"type": "github",
@@ -5347,11 +5357,14 @@
"optional": true
},
"node_modules/node-releases": {
- "version": "2.0.36",
- "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.36.tgz",
- "integrity": "sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA==",
+ "version": "2.0.48",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.48.tgz",
+ "integrity": "sha512-1uz8041X6LoI6ZSdZacM9lVY28vuzDlSKitnpbSNK0RfKoIJkX29NBPVEFXhnuSuEOA9Ww0xnPJ+ILWbGAv8DA==",
"dev": true,
- "license": "MIT"
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ }
},
"node_modules/obug": {
"version": "2.1.1",
@@ -5543,9 +5556,9 @@
}
},
"node_modules/postcss": {
- "version": "8.5.8",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.8.tgz",
- "integrity": "sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==",
+ "version": "8.5.15",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.15.tgz",
+ "integrity": "sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==",
"funding": [
{
"type": "opencollective",
@@ -5562,7 +5575,7 @@
],
"license": "MIT",
"dependencies": {
- "nanoid": "^3.3.11",
+ "nanoid": "^3.3.12",
"picocolors": "^1.1.1",
"source-map-js": "^1.2.1"
},
@@ -5882,13 +5895,13 @@
}
},
"node_modules/rolldown": {
- "version": "1.0.0-rc.15",
- "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.15.tgz",
- "integrity": "sha512-Ff31guA5zT6WjnGp0SXw76X6hzGRk/OQq2hE+1lcDe+lJdHSgnSX6nK3erbONHyCbpSj9a9E+uX/OvytZoWp2g==",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.3.tgz",
+ "integrity": "sha512-i00lAJ2ks1BYr7rjNjKC7BcqAS7nVfiT3QX1SI5aY+AFHblCmaUf9OE9dbdzDvW6dJxbi2ZCZiy9v3CcwOiX3g==",
"license": "MIT",
"dependencies": {
- "@oxc-project/types": "=0.124.0",
- "@rolldown/pluginutils": "1.0.0-rc.15"
+ "@oxc-project/types": "=0.133.0",
+ "@rolldown/pluginutils": "^1.0.0"
},
"bin": {
"rolldown": "bin/cli.mjs"
@@ -5897,27 +5910,27 @@
"node": "^20.19.0 || >=22.12.0"
},
"optionalDependencies": {
- "@rolldown/binding-android-arm64": "1.0.0-rc.15",
- "@rolldown/binding-darwin-arm64": "1.0.0-rc.15",
- "@rolldown/binding-darwin-x64": "1.0.0-rc.15",
- "@rolldown/binding-freebsd-x64": "1.0.0-rc.15",
- "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.15",
- "@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.15",
- "@rolldown/binding-linux-arm64-musl": "1.0.0-rc.15",
- "@rolldown/binding-linux-ppc64-gnu": "1.0.0-rc.15",
- "@rolldown/binding-linux-s390x-gnu": "1.0.0-rc.15",
- "@rolldown/binding-linux-x64-gnu": "1.0.0-rc.15",
- "@rolldown/binding-linux-x64-musl": "1.0.0-rc.15",
- "@rolldown/binding-openharmony-arm64": "1.0.0-rc.15",
- "@rolldown/binding-wasm32-wasi": "1.0.0-rc.15",
- "@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.15",
- "@rolldown/binding-win32-x64-msvc": "1.0.0-rc.15"
+ "@rolldown/binding-android-arm64": "1.0.3",
+ "@rolldown/binding-darwin-arm64": "1.0.3",
+ "@rolldown/binding-darwin-x64": "1.0.3",
+ "@rolldown/binding-freebsd-x64": "1.0.3",
+ "@rolldown/binding-linux-arm-gnueabihf": "1.0.3",
+ "@rolldown/binding-linux-arm64-gnu": "1.0.3",
+ "@rolldown/binding-linux-arm64-musl": "1.0.3",
+ "@rolldown/binding-linux-ppc64-gnu": "1.0.3",
+ "@rolldown/binding-linux-s390x-gnu": "1.0.3",
+ "@rolldown/binding-linux-x64-gnu": "1.0.3",
+ "@rolldown/binding-linux-x64-musl": "1.0.3",
+ "@rolldown/binding-openharmony-arm64": "1.0.3",
+ "@rolldown/binding-wasm32-wasi": "1.0.3",
+ "@rolldown/binding-win32-arm64-msvc": "1.0.3",
+ "@rolldown/binding-win32-x64-msvc": "1.0.3"
}
},
"node_modules/rolldown/node_modules/@rolldown/pluginutils": {
- "version": "1.0.0-rc.15",
- "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.15.tgz",
- "integrity": "sha512-UromN0peaE53IaBRe9W7CjrZgXl90fqGpK+mIZbA3qSTeYqg3pqpROBdIPvOG3F5ereDHNwoHBI2e50n1BDr1g==",
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz",
+ "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==",
"license": "MIT"
},
"node_modules/safe-buffer": {
@@ -6192,13 +6205,13 @@
}
},
"node_modules/tinyglobby": {
- "version": "0.2.15",
- "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz",
- "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==",
+ "version": "0.2.17",
+ "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz",
+ "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==",
"license": "MIT",
"dependencies": {
"fdir": "^6.5.0",
- "picomatch": "^4.0.3"
+ "picomatch": "^4.0.4"
},
"engines": {
"node": ">=12.0.0"
@@ -6568,9 +6581,9 @@
}
},
"node_modules/uuid": {
- "version": "13.0.0",
- "resolved": "https://registry.npmjs.org/uuid/-/uuid-13.0.0.tgz",
- "integrity": "sha512-XQegIaBTVUjSHliKqcnFqYypAd4S+WCYt5NIeRs6w/UAry7z8Y9j5ZwRRL4kzq9U3sD6v+85er9FvkEaBpji2w==",
+ "version": "13.0.2",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-13.0.2.tgz",
+ "integrity": "sha512-vzi9uRZ926x4XV73S/4qQaTwPXM2JBj6/6lI/byHH1jOpCzb0zDbfytgA9LcN/hzb2l7WQSQnxITOVx5un/wGw==",
"funding": [
"https://github.com/sponsors/broofa",
"https://github.com/sponsors/ctavan"
@@ -6623,16 +6636,16 @@
}
},
"node_modules/vite": {
- "version": "8.0.8",
- "resolved": "https://registry.npmjs.org/vite/-/vite-8.0.8.tgz",
- "integrity": "sha512-dbU7/iLVa8KZALJyLOBOQ88nOXtNG8vxKuOT4I2mD+Ya70KPceF4IAmDsmU0h1Qsn5bPrvsY9HJstCRh3hG6Uw==",
+ "version": "8.0.16",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-8.0.16.tgz",
+ "integrity": "sha512-h9bXPmJichP5fLmVQo3PyaGSDE2n3aPuomeAlVRm0JLmt4rY6zmPKd59HYI4LNW8oTK7tlTsuC7l/m7awx9Jcw==",
"license": "MIT",
"dependencies": {
"lightningcss": "^1.32.0",
"picomatch": "^4.0.4",
- "postcss": "^8.5.8",
- "rolldown": "1.0.0-rc.15",
- "tinyglobby": "^0.2.15"
+ "postcss": "^8.5.15",
+ "rolldown": "1.0.3",
+ "tinyglobby": "^0.2.17"
},
"bin": {
"vite": "bin/vite.js"
@@ -6648,7 +6661,7 @@
},
"peerDependencies": {
"@types/node": "^20.19.0 || >=22.12.0",
- "@vitejs/devtools": "^0.1.0",
+ "@vitejs/devtools": "^0.1.18",
"esbuild": "^0.27.0 || ^0.28.0",
"jiti": ">=1.21.0",
"less": "^4.0.0",
diff --git a/src-tauri/src/commands/agent.rs b/src-tauri/src/commands/agent.rs
index 23a361ef..cd86072a 100644
--- a/src-tauri/src/commands/agent.rs
+++ b/src-tauri/src/commands/agent.rs
@@ -94,14 +94,18 @@ fn normalize_duplicate_drive_prefix(path: &str) -> String {
}
}
-fn resolve_agent_path(path: &str, chat_id: Option<&str>, state: Option<&AppState>) -> PathBuf {
+/// Resolve + CONTAIN an agent file-op path to its per-chat workspace (or the
+/// user-picked override folder). A relative path resolves under the workspace;
+/// an absolute path is accepted only when it falls inside it. Any escape
+/// (`..`, an out-of-workspace absolute path) is rejected — this is the security
+/// boundary that stops a prompt-injected model or a remote client from reading
+/// `~/.ssh/id_rsa` or writing into the Startup folder.
+fn resolve_agent_path(path: &str, chat_id: Option<&str>, state: Option<&AppState>) -> Result<PathBuf, String> {
let cleaned = normalize_duplicate_drive_prefix(path);
+ let root = agent_workspace(chat_id, state);
let p = std::path::Path::new(&cleaned);
- if p.is_absolute() {
- p.to_path_buf()
- } else {
- agent_workspace(chat_id, state).join(&cleaned)
- }
+ let candidate = if p.is_absolute() { p.to_path_buf() } else { root.join(&cleaned) };
+ crate::commands::filesystem::contain_within(&root, &candidate)
}
#[cfg(test)]
@@ -230,30 +234,36 @@ mod path_tests {
.unwrap()
.insert("__remote__".to_string(), target.clone());
- let resolved = resolve_agent_path("client/public", Some("__remote__"), Some(&state));
+ let resolved = resolve_agent_path("client/public", Some("__remote__"), Some(&state)).unwrap();
let actual = resolved.to_string_lossy().replace('\\', "/");
let expected = target.join("client").join("public").to_string_lossy().replace('\\', "/");
assert_eq!(actual, expected);
}
- /// Absolute paths must NOT be rewritten — the user passed a literal
- /// drive path, we hand it back as-is.
+ /// Security (path-jail): an absolute path INSIDE the workspace is accepted,
+ /// but one OUTSIDE it is rejected — a remote client / model can't read or
+ /// write arbitrary disk locations by passing a literal drive path.
#[test]
- fn resolve_absolute_path_untouched_with_override() {
+ fn resolve_absolute_inside_override_is_allowed_outside_is_rejected() {
let state = AppState::new();
- let target = std::env::temp_dir().join("lu-test-remote-absolute-passthrough");
+ let target = std::env::temp_dir().join("lu-test-remote-jail");
state
.chat_workspace_overrides
.lock()
.unwrap()
.insert("__remote__".to_string(), target.clone());
- // Absolute path should pass through, ignoring the override.
- let abs = if cfg!(windows) { "C:/elsewhere/foo.txt" } else { "/tmp/elsewhere/foo.txt" };
- let resolved = resolve_agent_path(abs, Some("__remote__"), Some(&state));
- assert!(resolved.is_absolute());
- let s = resolved.to_string_lossy().to_string().replace('\\', "/");
- assert!(s.ends_with("/elsewhere/foo.txt"), "got: {}", s);
+ // Inside the override → allowed.
+ let inside = target.join("foo.txt");
+ let resolved = resolve_agent_path(&inside.to_string_lossy(), Some("__remote__"), Some(&state));
+ assert!(resolved.is_ok(), "inside path should be allowed: {:?}", resolved);
+
+ // Outside the override → rejected.
+ let abs = if cfg!(windows) { "C:/Windows/System32/foo.txt" } else { "/etc/passwd" };
+ assert!(resolve_agent_path(abs, Some("__remote__"), Some(&state)).is_err());
+
+ // `..` climbing out of the workspace → rejected.
+ assert!(resolve_agent_path("../../../../etc/passwd", Some("__remote__"), Some(&state)).is_err());
}
}
@@ -355,7 +365,7 @@ pub fn file_read(
chatId: Option<String>,
state: State<'_, AppState>,
) -> Result<serde_json::Value, String> {
- let full_path = resolve_agent_path(&path, chatId.as_deref(), Some(&*state));
+ let full_path = resolve_agent_path(&path, chatId.as_deref(), Some(&*state))?;
if !full_path.exists() {
return Err(format!("File not found: {}", full_path.display()));
}
@@ -372,7 +382,7 @@ pub fn file_write(
chatId: Option<String>,
state: State<'_, AppState>,
) -> Result<serde_json::Value, String> {
- let full_path = resolve_agent_path(&path, chatId.as_deref(), Some(&*state));
+ let full_path = resolve_agent_path(&path, chatId.as_deref(), Some(&*state))?;
if let Some(parent) = full_path.parent() {
fs::create_dir_all(parent).map_err(|e| format!("Create dir: {}", e))?;
}
diff --git a/src-tauri/src/commands/download.rs b/src-tauri/src/commands/download.rs
index a6f07276..1d51d71d 100644
--- a/src-tauri/src/commands/download.rs
+++ b/src-tauri/src/commands/download.rs
@@ -10,8 +10,65 @@ use tokio_util::sync::CancellationToken;
use crate::state::{AppState, DownloadProgress};
+/// Reduce a download filename to a safe basename — no path separators, no
+/// drive letter, no `..` — so a crafted `filename` (e.g. "..\\..\\Start
+/// Menu\\Programs\\Startup\\x.bat") can't escape the target directory and drop
+/// an autostart payload. Falls back to "download" if nothing usable remains.
+fn sanitize_filename(name: &str) -> String {
+ let base = name.rsplit(|c| c == '/' || c == '\\').next().unwrap_or("");
+ let cleaned: String = base.chars().filter(|c| !matches!(c, '/' | '\\' | ':' | '\0')).collect();
+ let cleaned = cleaned.trim();
+ if cleaned.is_empty() || cleaned == "." || cleaned == ".." {
+ "download".to_string()
+ } else {
+ cleaned.to_string()
+ }
+}
+
+/// Reject a subfolder that tries to escape the base (absolute path, drive
+/// letter, or any `..` segment). Returns the subfolder unchanged when safe.
+fn safe_subfolder(subfolder: &str) -> Result<(), String> {
+ let norm = subfolder.replace('\\', "/");
+ let p = std::path::Path::new(&norm);
+ // `starts_with('/')` also catches Windows drive-relative roots like `/x`,
+ // which `is_absolute()` does NOT treat as absolute.
+ if p.is_absolute() || norm.starts_with('/') || norm.contains(':') {
+ return Err("Invalid subfolder: absolute paths are not allowed".into());
+ }
+ if norm.split('/').any(|seg| seg == "..") {
+ return Err("Invalid subfolder: path traversal is not allowed".into());
+ }
+ Ok(())
+}
+
+#[cfg(test)]
+mod download_security_tests {
+ use super::{sanitize_filename, safe_subfolder};
+
+ #[test]
+ fn sanitize_strips_traversal_and_separators() {
+ assert_eq!(sanitize_filename("model.safetensors"), "model.safetensors");
+ assert_eq!(sanitize_filename("..\\..\\Startup\\x.bat"), "x.bat");
+ assert_eq!(sanitize_filename("a/b/c/evil.exe"), "evil.exe");
+ assert_eq!(sanitize_filename("C:evil.dll"), "Cevil.dll"); // colon stripped
+ assert_eq!(sanitize_filename(".."), "download");
+ assert_eq!(sanitize_filename(""), "download");
+ }
+
+ #[test]
+ fn safe_subfolder_rejects_escapes() {
+ assert!(safe_subfolder("checkpoints").is_ok());
+ assert!(safe_subfolder("custom_nodes/foo").is_ok());
+ assert!(safe_subfolder("../../etc").is_err());
+ assert!(safe_subfolder("a/../../b").is_err());
+ assert!(safe_subfolder("/abs/path").is_err());
+ assert!(safe_subfolder("C:/x").is_err());
+ }
+}
+
fn models_dir(comfy_path: &Option<String>, subfolder: &str) -> Result<PathBuf, String> {
let base = comfy_path.as_ref().ok_or("ComfyUI path not set. Please set it in settings or install ComfyUI first.")?;
+ safe_subfolder(subfolder)?;
// Subfolders starting with "custom_nodes/" are relative to ComfyUI root, not models/
let dir = if subfolder.starts_with("custom_nodes/") || subfolder.starts_with("custom_nodes\\") {
PathBuf::from(base).join(subfolder)
@@ -44,7 +101,7 @@ pub async fn download_model(
};
let dest_dir = models_dir(&comfy_path, &subfolder)?;
- let dest_file = dest_dir.join(&filename);
+ let dest_file = dest_dir.join(sanitize_filename(&filename));
if dest_file.exists() {
// If expected_bytes is provided, verify the file is at least 90% of expected size
@@ -155,9 +212,15 @@ async fn do_download(
token: CancellationToken,
resume_offset: u64,
) -> Result<(), String> {
+ // SSRF guard: model downloads come from public catalogs (HuggingFace,
+ // civitai, ollama). Block private/loopback/metadata hosts and re-validate
+ // every redirect hop so a crafted catalog/model URL can't pull from an
+ // internal service or 169.254.169.254.
+ crate::commands::proxy::validate_public_url(url)?;
+
let client = reqwest::Client::builder()
.user_agent("LocallyUncensored/1.5")
- .redirect(reqwest::redirect::Policy::limited(10))
+ .redirect(crate::commands::proxy::ssrf_safe_redirect_policy(10))
.timeout(std::time::Duration::from_secs(7200))
.build()
.map_err(|e| e.to_string())?;
@@ -572,7 +635,7 @@ pub async fn download_model_to_path(
let expected_bytes = expectedBytes;
let dir = PathBuf::from(&dest_dir);
fs::create_dir_all(&dir).map_err(|e| format!("Create dest dir: {}", e))?;
- let dest_file = dir.join(&filename);
+ let dest_file = dir.join(sanitize_filename(&filename));
if dest_file.exists() {
let file_complete = match expected_bytes {
diff --git a/src-tauri/src/commands/filesystem.rs b/src-tauri/src/commands/filesystem.rs
index 5d511477..2969f2b1 100644
--- a/src-tauri/src/commands/filesystem.rs
+++ b/src-tauri/src/commands/filesystem.rs
@@ -4,7 +4,7 @@ use std::time::UNIX_EPOCH;
use base64::Engine;
use glob::glob as glob_match;
-use regex::Regex;
+use regex::RegexBuilder;
use walkdir::WalkDir;
/// Strip duplicate drive-letter prefixes, e.g.
@@ -30,29 +30,60 @@ fn normalize_duplicate_drive_prefix(path: &str) -> String {
}
}
-/// Resolve path — supports absolute and relative paths. A relative path
-/// resolves against, in order: the agent's folder workspace `working_dir`
-/// (the repo the user picked, threaded from the frontend as
-/// `workingDirectory` via chatCtx) when set; otherwise the per-chat sandbox
-/// `~/agent-workspace/<chat_id>/`. Honoring `working_dir` is what makes a
-/// configured repo path actually win over the sandbox (#62) — before this,
-/// the frontend sent it but every command dropped it. `chat_id` is sanitised
-/// to `[A-Za-z0-9_\-\.]` (anything else → `_`) and capped at 64 chars to
-/// prevent path traversal. Missing chat_id falls back to `default`.
-fn resolve_path(path: &str, chat_id: Option<&str>, working_dir: Option<&str>) -> PathBuf {
- let cleaned = normalize_duplicate_drive_prefix(path);
- let p = Path::new(&cleaned);
- if p.is_absolute() {
- return p.to_path_buf();
+/// Lexically normalize a path (resolve `.` / `..` segments without touching
+/// the filesystem) so containment can be checked deterministically even for a
+/// path that doesn't exist yet (e.g. a file about to be created).
+fn lexical_normalize(p: &Path) -> PathBuf {
+ use std::path::Component;
+ let mut out = PathBuf::new();
+ for comp in p.components() {
+ match comp {
+ Component::ParentDir => { out.pop(); }
+ Component::CurDir => {}
+ other => out.push(other.as_os_str()),
+ }
}
- // Relative path: a configured folder workspace (the user's repo) wins over
- // the per-chat sandbox, so relative tool-call paths land where the user
- // expects. Blank/whitespace working_dir is treated as unset.
- if let Some(wd) = working_dir {
- let wd = wd.trim();
- if !wd.is_empty() {
- return PathBuf::from(wd).join(&cleaned);
+ out
+}
+
+/// Jail `candidate` to `root`: return the normalized path when it stays inside
+/// `root`, otherwise an error. This is the single containment boundary for
+/// every agent/remote file op — it stops a prompt-injected model or a remote
+/// client from reading `~/.ssh/id_rsa`, writing into `\Startup\`, or `..`-ing
+/// out of the workspace. Absolute paths are allowed ONLY when they fall within
+/// `root`, so the desktop coding agent can still use absolute paths inside the
+/// user-picked project folder (#62). Symlink-based escape is a residual (it
+/// needs a prior local write) and is intentionally out of scope here.
+pub(crate) fn contain_within(root: &Path, candidate: &Path) -> Result<PathBuf, String> {
+ let nroot = lexical_normalize(root);
+ let ncand = lexical_normalize(candidate);
+ let within = {
+ #[cfg(windows)]
+ {
+ // Windows paths are case-insensitive; compare lowercased with a
+ // component boundary so `…/foo` can't match `…/foobar`.
+ let r = nroot.to_string_lossy().to_lowercase().replace('\\', "/");
+ let r = r.trim_end_matches('/');
+ let c = ncand.to_string_lossy().to_lowercase().replace('\\', "/");
+ c == r || c.starts_with(&format!("{}/", r))
}
+ #[cfg(not(windows))]
+ { ncand == nroot || ncand.starts_with(&nroot) }
+ };
+ if within {
+ Ok(ncand)
+ } else {
+ Err(format!("Path escapes the allowed workspace: {}", candidate.display()))
+ }
+}
+
+/// The jail root for a file op: a configured folder workspace `working_dir`
+/// (the repo the user picked, threaded from the frontend as `workingDirectory`)
+/// when set; otherwise the per-chat sandbox `~/agent-workspace/<chat_id>/`.
+/// `chat_id` is sanitised to `[A-Za-z0-9_\-\.]` (else `_`), capped at 64 chars.
+pub(crate) fn workspace_root(chat_id: Option<&str>, working_dir: Option<&str>) -> PathBuf {
+ if let Some(wd) = working_dir.map(str::trim).filter(|w| !w.is_empty()) {
+ return PathBuf::from(wd);
}
let id = chat_id.unwrap_or("default");
let safe: String = id
@@ -61,11 +92,20 @@ fn resolve_path(path: &str, chat_id: Option<&str>, working_dir: Option<&str>) ->
.map(|c| if c.is_ascii_alphanumeric() || c == '_' || c == '-' || c == '.' { c } else { '_' })
.collect();
let slug = if safe.is_empty() { "default".to_string() } else { safe };
- dirs::home_dir()
- .unwrap_or_default()
- .join("agent-workspace")
- .join(slug)
- .join(&cleaned)
+ dirs::home_dir().unwrap_or_default().join("agent-workspace").join(slug)
+}
+
+/// Resolve + CONTAIN a tool-call path. A relative path resolves against the
+/// workspace root (folder workspace #62, else the per-chat sandbox); an
+/// absolute path is accepted only when it falls inside that root. Returns an
+/// error on any escape (`..`, an out-of-root absolute path, etc.) — the
+/// security boundary for fs_read/fs_write/fs_list/fs_search/fs_info.
+fn resolve_path(path: &str, chat_id: Option<&str>, working_dir: Option<&str>) -> Result<PathBuf, String> {
+ let cleaned = normalize_duplicate_drive_prefix(path);
+ let root = workspace_root(chat_id, working_dir);
+ let p = Path::new(&cleaned);
+ let candidate = if p.is_absolute() { p.to_path_buf() } else { root.join(&cleaned) };
+ contain_within(&root, &candidate)
}
/// True when `path` addresses the workspace ROOT itself ("", ".", "./",
@@ -103,7 +143,7 @@ fn file_meta(path: &Path) -> serde_json::Value {
#[tauri::command]
#[allow(non_snake_case)]
pub fn fs_read(path: String, chatId: Option<String>, workingDirectory: Option<String>) -> Result<serde_json::Value, String> {
- let full = resolve_path(&path, chatId.as_deref(), workingDirectory.as_deref());
+ let full = resolve_path(&path, chatId.as_deref(), workingDirectory.as_deref())?;
if !full.exists() {
return Err(format!("File not found: {}", full.display()));
}
@@ -122,7 +162,7 @@ pub fn fs_read(path: String, chatId: Option<String>, workingDirectory: Option<St
#[tauri::command]
#[allow(non_snake_case)]
pub fn fs_write(path: String, content: String, chatId: Option<String>, workingDirectory: Option<String>) -> Result<serde_json::Value, String> {
- let full = resolve_path(&path, chatId.as_deref(), workingDirectory.as_deref());
+ let full = resolve_path(&path, chatId.as_deref(), workingDirectory.as_deref())?;
if let Some(parent) = full.parent() {
fs::create_dir_all(parent).map_err(|e| format!("Create dir: {}", e))?;
}
@@ -139,7 +179,7 @@ pub fn fs_list(
chatId: Option<String>,
workingDirectory: Option<String>,
) -> Result<serde_json::Value, String> {
- let dir = resolve_path(&path, chatId.as_deref(), workingDirectory.as_deref());
+ let dir = resolve_path(&path, chatId.as_deref(), workingDirectory.as_deref())?;
if !dir.is_dir() {
// A fresh per-chat agent sandbox (~/agent-workspace/<chat_id>) may not
// exist yet. When the model lists the workspace ROOT with a relative
@@ -199,12 +239,19 @@ pub fn fs_search(
chatId: Option<String>,
workingDirectory: Option<String>,
) -> Result<serde_json::Value, String> {
- let dir = resolve_path(&path, chatId.as_deref(), workingDirectory.as_deref());
+ let dir = resolve_path(&path, chatId.as_deref(), workingDirectory.as_deref())?;
if !dir.is_dir() {
return Err(format!("Not a directory: {}", dir.display()));
}
- let re = Regex::new(&pattern).map_err(|e| format!("Invalid regex: {}", e))?;
+ // Bound the compiled regex so a pathological pattern can't blow up memory.
+ // (The `regex` crate is already linear-time, so there's no catastrophic
+ // backtracking; this caps the compiled-program size.)
+ let re = RegexBuilder::new(&pattern)
+ .size_limit(1 << 20)
+ .dfa_size_limit(1 << 20)
+ .build()
+ .map_err(|e| format!("Invalid regex: {}", e))?;
let max = max_results.unwrap_or(50) as usize;
let mut results: Vec<serde_json::Value> = Vec::new();
@@ -253,7 +300,7 @@ pub fn fs_search(
#[tauri::command]
#[allow(non_snake_case)]
pub fn fs_info(path: String, chatId: Option<String>, workingDirectory: Option<String>) -> Result<serde_json::Value, String> {
- let full = resolve_path(&path, chatId.as_deref(), workingDirectory.as_deref());
+ let full = resolve_path(&path, chatId.as_deref(), workingDirectory.as_deref())?;
if !full.exists() {
return Err(format!("Path not found: {}", full.display()));
}
@@ -379,30 +426,52 @@ mod tests {
// ── #62: relative paths must honor the folder workspace ──────────
#[test]
fn relative_path_resolves_against_working_dir() {
- let got = resolve_path("src/main.rs", Some("chat-1"), Some("D:/Projects/site"));
+ let got = resolve_path("src/main.rs", Some("chat-1"), Some("D:/Projects/site")).unwrap();
let s = got.to_string_lossy().replace('\\', "/");
assert_eq!(s, "D:/Projects/site/src/main.rs");
}
#[test]
fn relative_path_without_working_dir_uses_sandbox() {
- let got = resolve_path("notes.md", Some("chat-1"), None);
+ let got = resolve_path("notes.md", Some("chat-1"), None).unwrap();
let s = got.to_string_lossy().replace('\\', "/");
assert!(s.contains("agent-workspace/chat-1/notes.md"), "got: {}", s);
}
#[test]
fn blank_working_dir_falls_back_to_sandbox() {
- let got = resolve_path("a.txt", Some("c"), Some(" "));
+ let got = resolve_path("a.txt", Some("c"), Some(" ")).unwrap();
let s = got.to_string_lossy().replace('\\', "/");
assert!(s.contains("agent-workspace/c/a.txt"), "got: {}", s);
}
+ // ── Path-jail (security): absolute paths are allowed only inside the root ──
#[test]
- fn absolute_path_ignores_working_dir() {
- let abs = if cfg!(windows) { "C:/abs/file.txt" } else { "/abs/file.txt" };
- let got = resolve_path(abs, Some("chat-1"), Some("D:/Projects/site"));
+ fn absolute_path_inside_working_dir_is_allowed() {
+ let (root, abs) = if cfg!(windows) {
+ ("D:/Projects/site", "D:/Projects/site/src/main.rs")
+ } else {
+ ("/projects/site", "/projects/site/src/main.rs")
+ };
+ let got = resolve_path(abs, Some("chat-1"), Some(root)).unwrap();
let s = got.to_string_lossy().replace('\\', "/");
assert_eq!(s, abs);
}
+
+ #[test]
+ fn absolute_path_outside_working_dir_is_rejected() {
+ let abs = if cfg!(windows) { "C:/Windows/System32/x.txt" } else { "/etc/passwd" };
+ assert!(resolve_path(abs, Some("chat-1"), Some("D:/Projects/site")).is_err());
+ }
+
+ #[test]
+ fn dotdot_traversal_out_of_sandbox_is_rejected() {
+ // relative path that climbs out of the per-chat sandbox
+ assert!(resolve_path("../../../../Windows/x.txt", Some("chat-1"), None).is_err());
+ }
+
+ #[test]
+ fn dotdot_traversal_out_of_working_dir_is_rejected() {
+ assert!(resolve_path("../../secret.txt", Some("c"), Some("D:/Projects/site")).is_err());
+ }
}
diff --git a/src-tauri/src/commands/proxy.rs b/src-tauri/src/commands/proxy.rs
index 6fcf8b1a..f7e80765 100644
--- a/src-tauri/src/commands/proxy.rs
+++ b/src-tauri/src/commands/proxy.rs
@@ -55,11 +55,12 @@ fn validate_external_url(raw: &str) -> Result<(), String> {
/// Used for CivitAI API calls, workflow JSON downloads, etc.
#[tauri::command]
pub async fn fetch_external(url: String) -> Result<String, String> {
- validate_external_url(&url)?;
+ validate_public_url(&url)?;
let client = reqwest::Client::builder()
.user_agent("LocallyUncensored/2.0")
.timeout(std::time::Duration::from_secs(60))
+ .redirect(ssrf_safe_redirect_policy(10))
.build()
.map_err(|e| e.to_string())?;
@@ -79,11 +80,12 @@ pub async fn fetch_external(url: String) -> Result<String, String> {
/// Used for downloading ZIP files, images, model files.
#[tauri::command]
pub async fn fetch_external_bytes(url: String) -> Result<Vec<u8>, String> {
- validate_external_url(&url)?;
+ validate_public_url(&url)?;
let client = reqwest::Client::builder()
.user_agent("LocallyUncensored/2.0")
.timeout(std::time::Duration::from_secs(300))
+ .redirect(ssrf_safe_redirect_policy(10))
.build()
.map_err(|e| e.to_string())?;
@@ -153,6 +155,50 @@ fn is_blocked_proxy_host(host: &str) -> bool {
false
}
+/// Strict public-URL validation for agent/downloader fetches: http(s) only and
+/// the host must not be localhost, a private/reserved range, or a cloud-metadata
+/// endpoint (incl. IPv4-mapped-IPv6 forms). Combines `validate_external_url`
+/// (RFC1918/loopback/link-local ranges) with `is_blocked_proxy_host`
+/// (metadata + mapped-v6). This is the single SSRF gate — reuse it everywhere
+/// instead of ad-hoc substring blocklists (which miss 172.16/12, IPv6, and
+/// decimal/hex/octal IP encodings).
+pub(crate) fn validate_public_url(raw: &str) -> Result<(), String> {
+ validate_external_url(raw)?;
+ let parsed = url::Url::parse(raw).map_err(|e| format!("Invalid URL: {}", e))?;
+ let host = parsed.host_str().unwrap_or("");
+ if is_blocked_proxy_host(host) {
+ return Err("Blocked: cloud-metadata / link-local address".into());
+ }
+ // Reject inet_aton-style numeric hosts: a bare decimal integer
+ // (http://2852039166 == 169.254.169.254) or a 0x-hex integer
+ // (http://0xA9FEA9FE) parses as a "domain" here, slips past the
+ // dotted-quad range checks, then the OS resolver expands it to an IP. A
+ // legitimate public hostname is never all-digits or `0x…`.
+ let h = host.trim_matches(|c| c == '[' || c == ']').to_lowercase();
+ let is_decimal_int = !h.is_empty() && h.chars().all(|c| c.is_ascii_digit());
+ let is_hex_int = h.starts_with("0x") && h.len() > 2 && h[2..].chars().all(|c| c.is_ascii_hexdigit());
+ if is_decimal_int || is_hex_int {
+ return Err("Blocked: numeric host form (possible IP-encoding bypass)".into());
+ }
+ Ok(())
+}
+
+/// Redirect policy that re-validates EVERY hop with `validate_public_url`, so a
+/// public URL can't 30x-redirect into localhost / a private host / cloud
+/// metadata (the classic SSRF-via-redirect bypass). Use this on any reqwest
+/// client that fetches a renderer- or model-supplied URL.
+pub(crate) fn ssrf_safe_redirect_policy(max: usize) -> reqwest::redirect::Policy {
+ reqwest::redirect::Policy::custom(move |attempt| {
+ if attempt.previous().len() >= max {
+ return attempt.error("too many redirects");
+ }
+ match validate_public_url(attempt.url().as_str()) {
+ Ok(()) => attempt.follow(),
+ Err(_) => attempt.error("redirect to a blocked (private/metadata) host"),
+ }
+ })
+}
+
/// True only for private/LAN hosts a user could legitimately point a local
/// backend at. `register_openai_host` requires this so the RUST boundary — not
/// the JS caller — enforces the LAN-only intent and can't be tricked into
@@ -782,6 +828,42 @@ mod tests {
assert!(!is_blocked_proxy_host("2606:4700::1111"));
}
+ #[test]
+ fn validate_public_url_blocks_private_and_loopback() {
+ for u in [
+ "http://localhost/x", "http://127.0.0.1/x", "http://10.0.0.5/x",
+ "http://192.168.1.1/x", "http://172.16.4.4/x", "http://169.254.169.254/x",
+ "http://[::1]/x", "http://[fd00::1]/x", "http://0.0.0.0/x",
+ ] {
+ assert!(validate_public_url(u).is_err(), "{} should be blocked", u);
+ }
+ }
+
+ #[test]
+ fn validate_public_url_blocks_numeric_ip_encodings() {
+ // inet_aton-style forms the OS resolver would expand to a blocked IP.
+ assert!(validate_public_url("http://2852039166/").is_err()); // decimal 169.254.169.254
+ assert!(validate_public_url("http://0xA9FEA9FE/").is_err()); // hex 169.254.169.254
+ assert!(validate_public_url("http://0x7f000001/").is_err()); // hex 127.0.0.1
+ }
+
+ #[test]
+ fn validate_public_url_blocks_non_http_schemes() {
+ assert!(validate_public_url("file:///etc/passwd").is_err());
+ assert!(validate_public_url("ftp://example.com/x").is_err());
+ assert!(validate_public_url("not a url").is_err());
+ }
+
+ #[test]
+ fn validate_public_url_allows_real_public_hosts() {
+ for u in [
+ "https://huggingface.co/model", "https://civitai.com/api",
+ "http://example.com/", "https://8.8.8.8/", "https://3com.com/",
+ ] {
+ assert!(validate_public_url(u).is_ok(), "{} should be allowed", u);
+ }
+ }
+
#[test]
fn register_only_private_lan_hosts() {
// M2: public + junk hosts must NOT be registerable; private/LAN are.
diff --git a/src-tauri/src/commands/remote.rs b/src-tauri/src/commands/remote.rs
index 4bb0ae51..515d9713 100644
--- a/src-tauri/src/commands/remote.rs
+++ b/src-tauri/src/commands/remote.rs
@@ -43,6 +43,13 @@ pub struct RemotePermissions {
pub filesystem: bool,
pub downloads: bool,
pub process_control: bool,
+ /// Shell + arbitrary code execution over the remote bridge. OFF by default:
+ /// this is RCE-equivalent, so it must be explicitly opted into and is kept
+ /// SEPARATE from `filesystem` (granting file access should never imply
+ /// arbitrary command execution). `#[serde(default)]` so older client
+ /// payloads that omit the field deserialize to `false`.
+ #[serde(default)]
+ pub shell: bool,
}
impl Default for RemotePermissions {
@@ -51,6 +58,7 @@ impl Default for RemotePermissions {
filesystem: true,
downloads: true,
process_control: true,
+ shell: false,
}
}
}
@@ -263,6 +271,14 @@ async fn handle_auth(
Json(body): Json<AuthRequest>,
) -> Response {
let ip = client_ip(&headers, Some(addr));
+ // Anti-spoof: rate-limit/lockout is keyed on the REAL TCP peer
+ // (`ConnectInfo`), NOT on `X-Forwarded-For`. A client can set XFF to a
+ // fresh value per request and otherwise reset the per-IP cooldown, which
+ // would make the 6-digit passcode brute-forceable. Over the Cloudflare
+ // tunnel every request shares cloudflared's loopback peer, so they share
+ // one (stricter) bucket — acceptable. `ip` above stays XFF-aware for the
+ // device label / JWT claim only.
+ let rate_key = addr.ip().to_string();
let now = chrono_now_secs();
@@ -271,7 +287,7 @@ async fn handle_auth(
let mut pc = state.passcode.lock().await;
// Rate limit check
- if let Some(&(count, cooldown_until)) = pc.failed_attempts.get(&ip) {
+ if let Some(&(count, cooldown_until)) = pc.failed_attempts.get(&rate_key) {
if count >= MAX_FAILED_ATTEMPTS && now < cooldown_until {
let remaining = cooldown_until - now;
return (StatusCode::TOO_MANY_REQUESTS,
@@ -280,7 +296,7 @@ async fn handle_auth(
}
// Reset if cooldown expired
if count >= MAX_FAILED_ATTEMPTS && now >= cooldown_until {
- pc.failed_attempts.remove(&ip);
+ pc.failed_attempts.remove(&rate_key);
}
}
@@ -293,7 +309,7 @@ async fn handle_auth(
// Verify passcode
if body.passcode != pc.code {
- let entry = pc.failed_attempts.entry(ip.clone()).or_insert((0, 0));
+ let entry = pc.failed_attempts.entry(rate_key.clone()).or_insert((0, 0));
entry.0 += 1;
if entry.0 >= MAX_FAILED_ATTEMPTS {
entry.1 = now + COOLDOWN_SECS;
@@ -302,7 +318,7 @@ async fn handle_auth(
}
// Success: clear failed attempts
- pc.failed_attempts.remove(&ip);
+ pc.failed_attempts.remove(&rate_key);
}
let user_agent = headers.get(header::USER_AGENT)
@@ -409,21 +425,24 @@ pub(crate) fn resolve_remote_path(
path: &str,
chat_id: Option<&str>,
state: &crate::state::AppState,
-) -> String {
+) -> Result<String, String> {
use std::path::Path;
- if Path::new(path).is_absolute() {
- path.to_string()
- } else {
- let workspace = crate::commands::agent::agent_workspace_for(chat_id, state);
- workspace.join(path).to_string_lossy().to_string()
- }
+ // CONTAIN to the remote workspace (the user-picked override folder or the
+ // per-chat sandbox). A remote client must not be able to read/write/cd
+ // outside it via an absolute path or `..` (security: this is the network
+ // attack surface).
+ let workspace = crate::commands::agent::agent_workspace_for(chat_id, state);
+ let p = Path::new(path);
+ let candidate = if p.is_absolute() { p.to_path_buf() } else { workspace.join(path) };
+ let contained = crate::commands::filesystem::contain_within(&workspace, &candidate)?;
+ Ok(contained.to_string_lossy().to_string())
}
/// Run a single agent tool on behalf of an authenticated mobile client.
/// Mirrors `executeTool` in `src/api/agents.ts`. Permission-gated so a
/// remote client cannot reach into the desktop without explicit toggle:
/// - file_read / file_write → requires `filesystem`
-/// - code_execute → requires `filesystem`
+/// - shell_execute / code_execute → requires `shell` (default OFF, RCE-class)
/// - image_generate → requires `process_control`
/// - web_search → no permission required
///
@@ -453,7 +472,12 @@ async fn handle_agent_tool(
// Permission gate up-front. Returns a graceful 200 + {error,permission}
// so the mobile UI can render a single-line hint instead of "HTTP 403".
let needs = match tool_name.as_str() {
- "file_read" | "file_write" | "code_execute" | "file_list" | "file_search" | "shell_execute" | "screenshot"
+ // RCE-equivalent: gated behind the dedicated, default-OFF `shell`
+ // permission (NOT `filesystem`) so a remote client can't get arbitrary
+ // command/code execution just by having file access enabled.
+ "shell_execute" | "code_execute"
+ => Some(("shell", perms.shell)),
+ "file_read" | "file_write" | "file_list" | "file_search" | "screenshot"
=> Some(("filesystem", perms.filesystem)),
"image_generate"
=> Some(("process_control", perms.process_control)),
@@ -530,12 +554,13 @@ async fn handle_agent_tool(
let pattern = body.args.get("pattern").and_then(|v| v.as_str()).map(String::from);
if raw_path.is_empty() { Err("file_list needs a non-empty `path` argument.".into()) }
else {
- // Pre-resolve so relative paths land in the user-picked
- // Remote workspace, not in `~/agent-workspace/__remote__/`.
- // fs_list itself doesn't see AppState — pass an absolute
- // path so it skips its own resolver.
- let resolved = resolve_remote_path(&raw_path, chat_id.as_deref(), &app_state);
- crate::commands::filesystem::fs_list(resolved, recursive, pattern, None, None)
+ // Pass the user-picked Remote workspace as the working dir so
+ // fs_list resolves relatives there AND re-applies the path-jail
+ // against it — an absolute or `..` path can't escape the
+ // workspace (security: remote = network surface).
+ let ws = crate::commands::agent::agent_workspace_for(chat_id.as_deref(), &app_state)
+ .to_string_lossy().to_string();
+ crate::commands::filesystem::fs_list(raw_path, recursive, pattern, None, Some(ws))
}
}
"file_search" => {
@@ -552,8 +577,10 @@ async fn handle_agent_tool(
if raw_path.is_empty() || pattern.is_empty() {
Err("file_search needs both `path` and `pattern` arguments.".into())
} else {
- let resolved = resolve_remote_path(&raw_path, chat_id.as_deref(), &app_state);
- crate::commands::filesystem::fs_search(resolved, pattern, max, None, None)
+ // Jail to the remote workspace (see file_list above).
+ let ws = crate::commands::agent::agent_workspace_for(chat_id.as_deref(), &app_state)
+ .to_string_lossy().to_string();
+ crate::commands::filesystem::fs_search(raw_path, pattern, max, None, Some(ws))
}
}
"shell_execute" => {
@@ -566,12 +593,14 @@ async fn handle_agent_tool(
// app's launch directory and every relative command fails
// with "no such file" while the model thinks it succeeded.
let cwd_raw = body.args.get("cwd").and_then(|v| v.as_str()).map(String::from);
- let cwd = match cwd_raw {
- Some(c) if !c.trim().is_empty() => Some(resolve_remote_path(&c, chat_id.as_deref(), &app_state)),
- _ => Some(crate::commands::agent::agent_workspace_for(chat_id.as_deref(), &app_state)
+ // Jail the cwd to the remote workspace; an out-of-workspace cwd
+ // falls back to the workspace root rather than running anywhere.
+ let cwd = cwd_raw
+ .filter(|c| !c.trim().is_empty())
+ .and_then(|c| resolve_remote_path(&c, chat_id.as_deref(), &app_state).ok())
+ .or_else(|| Some(crate::commands::agent::agent_workspace_for(chat_id.as_deref(), &app_state)
.to_string_lossy()
- .to_string()),
- };
+ .to_string()));
// Best-effort: ensure the cwd exists before the shell command
// runs. Saves the model an extra "Error: directory not found"
// round-trip for the very first shell call in a new chat.
@@ -3812,9 +3841,16 @@ pub async fn start_remote_server(
)
}; // std::sync::MutexGuard dropped here
- // Generate new passcode + JWT secret
+ // Generate new passcode + JWT secret. The secret is 32 bytes from a CSPRNG
+ // (256-bit) — the old `lu-<timestamp>-<u64>` form had a guessable prefix
+ // and only ~64 bits of entropy.
let passcode = generate_passcode();
- let jwt_secret_str = format!("lu-{}-{}", chrono_now_secs(), rand::random::<u64>());
+ let jwt_secret_str = {
+ use rand::RngCore;
+ let mut bytes = [0u8; 32];
+ rand::thread_rng().fill_bytes(&mut bytes);
+ bytes.iter().map(|b| format!("{:02x}", b)).collect::<String>()
+ };
let now = chrono_now_secs();
// Update shared state (safe to .await now, no std::sync::MutexGuard held)
@@ -4404,7 +4440,12 @@ pub async fn tunnel_status(
// ─── Router builder ───
fn build_router(state: RemoteState) -> Router {
- let cors = CorsLayer::permissive();
+ // Same-origin only. The mobile page is served from this server and calls
+ // its APIs same-origin, so no cross-origin access is needed. The previous
+ // `CorsLayer::permissive()` reflected ANY origin onto the shell/file/proxy
+ // routes — an unnecessary exposure if a token ever leaked. `new()` adds no
+ // permissive CORS headers (same-origin requests are unaffected).
+ let cors = CorsLayer::new();
// API routes. `/remote-api/auth` + `/remote-api/status` are explicitly
// public (handled in auth_middleware). Everything else in this router
@@ -4481,7 +4522,7 @@ mod remote_path_tests {
#[test]
fn relative_without_override_uses_default_workspace() {
let state = AppState::new();
- let resolved = resolve_remote_path("client/public", Some("__remote__"), &state);
+ let resolved = resolve_remote_path("client/public", Some("__remote__"), &state).unwrap();
let s = resolved.replace('\\', "/");
assert!(s.contains("agent-workspace/__remote__/client/public"), "got: {}", s);
}
@@ -4500,7 +4541,7 @@ mod remote_path_tests {
.unwrap()
.insert("__remote__".to_string(), target.clone());
- let resolved = resolve_remote_path("client/public/index.html", Some("__remote__"), &state);
+ let resolved = resolve_remote_path("client/public/index.html", Some("__remote__"), &state).unwrap();
let actual = resolved.replace('\\', "/");
let expected = target
.join("client")
@@ -4511,26 +4552,44 @@ mod remote_path_tests {
assert_eq!(actual, expected);
}
- /// Absolute paths must pass through untouched even when an override is set.
+ /// Security (path-jail): an absolute path INSIDE the override workspace is
+ /// accepted, but one OUTSIDE it — or a `..` escape — is rejected, so a
+ /// remote client can't read/write/cd to arbitrary disk locations.
#[test]
- fn absolute_path_passes_through_with_override() {
+ fn absolute_inside_ok_outside_and_traversal_rejected() {
let state = AppState::new();
- let target = std::env::temp_dir().join("lu-rrp-test-abs");
+ let target = std::env::temp_dir().join("lu-rrp-test-jail");
state
.chat_workspace_overrides
.lock()
.unwrap()
- .insert("__remote__".to_string(), target);
+ .insert("__remote__".to_string(), target.clone());
- let abs = if cfg!(windows) { "C:/elsewhere/foo.txt" } else { "/etc/passwd" };
- let resolved = resolve_remote_path(abs, Some("__remote__"), &state);
- let s = resolved.replace('\\', "/");
- // We ignore drive vs unix specifics — just assert we kept the
- // input absolute form rather than nesting it under the override.
- if cfg!(windows) {
- assert!(s.ends_with("/elsewhere/foo.txt"), "got: {}", s);
- } else {
- assert!(s.ends_with("/etc/passwd"), "got: {}", s);
- }
+ // Inside the workspace → allowed.
+ let inside = target.join("sub").join("foo.txt");
+ assert!(resolve_remote_path(&inside.to_string_lossy(), Some("__remote__"), &state).is_ok());
+
+ // Outside the workspace → rejected.
+ let abs = if cfg!(windows) { "C:/Windows/System32/foo.txt" } else { "/etc/passwd" };
+ assert!(resolve_remote_path(abs, Some("__remote__"), &state).is_err());
+
+ // `..` climbing out → rejected.
+ assert!(resolve_remote_path("../../../../etc/passwd", Some("__remote__"), &state).is_err());
+ }
+
+ #[test]
+ fn shell_permission_is_off_by_default() {
+ // C1: a freshly-dispatched remote server must NOT grant shell/code
+ // execution by default — it's RCE-class and opt-in only.
+ let p = super::RemotePermissions::default();
+ assert!(!p.shell, "remote `shell` permission must default to false");
+ }
+
+ #[test]
+ fn remote_permissions_deserialize_without_shell_defaults_false() {
+ // Older mobile/client payloads omit `shell`; serde default must be false.
+ let p: super::RemotePermissions =
+ serde_json::from_str(r#"{"filesystem":true,"downloads":true,"process_control":true}"#).unwrap();
+ assert!(!p.shell);
}
}
diff --git a/src-tauri/src/commands/search.rs b/src-tauri/src/commands/search.rs
index 2a13e00d..90465b4a 100644
--- a/src-tauri/src/commands/search.rs
+++ b/src-tauri/src/commands/search.rs
@@ -457,27 +457,18 @@ pub fn searxng_status(state: State<'_, AppState>) -> Result<serde_json::Value, S
/// - Caps at ~24 000 chars so we don't blow the context window
#[tauri::command]
pub async fn web_fetch(url: String) -> Result<serde_json::Value, String> {
- // Basic URL hardening: must start http(s) and not point at localhost /
- // private IPs. The agent should fetch public pages, not poke internal
- // services (Ollama, ComfyUI, LAN boxes).
+ // URL hardening: http(s) only and the host must not be localhost, a
+ // private/reserved range, or a cloud-metadata endpoint. The agent should
+ // fetch public pages, not poke internal services (Ollama, ComfyUI, LAN
+ // boxes, 169.254.169.254). Reuse the shared SSRF validator — the old
+ // substring blocklist missed 172.16/12, IPv6, and decimal/hex/octal IP
+ // encodings, and didn't re-check redirects.
let trimmed = url.trim();
- if !(trimmed.starts_with("http://") || trimmed.starts_with("https://")) {
- return Err("URL must start with http:// or https://".into());
- }
- let lower = trimmed.to_lowercase();
- if lower.contains("://localhost")
- || lower.contains("://127.")
- || lower.contains("://0.0.0.0")
- || lower.contains("://10.")
- || lower.contains("://192.168.")
- || lower.contains("://169.254.")
- {
- return Err("Refusing to fetch private / loopback addresses from the agent.".into());
- }
+ crate::commands::proxy::validate_public_url(trimmed)?;
let client = reqwest::Client::builder()
.timeout(std::time::Duration::from_secs(20))
- .redirect(reqwest::redirect::Policy::limited(6))
+ .redirect(crate::commands::proxy::ssrf_safe_redirect_policy(6))
.user_agent("Mozilla/5.0 (compatible; LocallyUncensored-Agent/1.0)")
.build()
.map_err(|e| e.to_string())?;
diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json
index d1717085..9f74c23e 100644
--- a/src-tauri/tauri.conf.json
+++ b/src-tauri/tauri.conf.json
@@ -24,7 +24,7 @@
}
],
"security": {
- "csp": "default-src 'self' http://ipc.localhost; connect-src 'self' http://ipc.localhost http://tauri.localhost http://localhost:* http://127.0.0.1:* https://civitai.com https://*.civitai.com https://huggingface.co https://*.huggingface.co https://ollama.com ws://localhost:8188 ws://127.0.0.1:8188; img-src 'self' data: blob: http://localhost:8188 http://127.0.0.1:8188 https://*.civitai.com https://*.githubusercontent.com; media-src 'self' blob: http://localhost:8188 http://127.0.0.1:8188; font-src 'self' data:; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'"
+ "csp": "default-src 'self' http://ipc.localhost; connect-src 'self' http://ipc.localhost http://tauri.localhost http://localhost:* http://127.0.0.1:* https://civitai.com https://*.civitai.com https://huggingface.co https://*.huggingface.co https://ollama.com ws://localhost:8188 ws://127.0.0.1:8188; img-src 'self' data: blob: http://localhost:8188 http://127.0.0.1:8188 https://*.civitai.com https://*.githubusercontent.com; media-src 'self' blob: http://localhost:8188 http://127.0.0.1:8188; font-src 'self' data:; style-src 'self' 'unsafe-inline'; script-src 'self' 'wasm-unsafe-eval'"
}
},
"plugins": {
diff --git a/src/api/__tests__/openExternal.test.ts b/src/api/__tests__/openExternal.test.ts
new file mode 100644
index 00000000..78bb0234
--- /dev/null
+++ b/src/api/__tests__/openExternal.test.ts
@@ -0,0 +1,24 @@
+import { describe, it, expect } from 'vitest'
+import { isSafeExternalUrl } from '../backend'
+
+// C3: openExternal hands the URL to the OS shell (`plugin:shell|open`). A
+// model- or web-content-supplied markdown link must only ever be a web/mail
+// link — never file://, a custom protocol handler, a UNC path, or javascript:.
+describe('isSafeExternalUrl', () => {
+ it('allows http / https / mailto', () => {
+ expect(isSafeExternalUrl('http://example.com')).toBe(true)
+ expect(isSafeExternalUrl('https://example.com/path?q=1#frag')).toBe(true)
+ expect(isSafeExternalUrl('mailto:[email protected]')).toBe(true)
+ })
+
+ it('blocks file / custom-protocol / data / javascript / UNC / relative / garbage', () => {
+ expect(isSafeExternalUrl('file:///C:/Windows/System32/calc.exe')).toBe(false)
+ expect(isSafeExternalUrl('javascript:alert(1)')).toBe(false)
+ expect(isSafeExternalUrl('data:text/html,<script>alert(1)</script>')).toBe(false)
+ expect(isSafeExternalUrl('vscode://foo/bar')).toBe(false)
+ expect(isSafeExternalUrl('\\\\server\\share\\x')).toBe(false)
+ expect(isSafeExternalUrl('/etc/passwd')).toBe(false)
+ expect(isSafeExternalUrl('not a url')).toBe(false)
+ expect(isSafeExternalUrl('')).toBe(false)
+ })
+})
diff --git a/src/api/backend.ts b/src/api/backend.ts
index 28963c9e..a0d50cbb 100644
--- a/src/api/backend.ts
+++ b/src/api/backend.ts
@@ -657,8 +657,29 @@ export async function fetchLocalhostBytes(url: string): Promise<Uint8Array> {
return new Uint8Array(await res.arrayBuffer())
}
+/**
+ * True only for URLs that are safe to hand to the OS shell / a new window:
+ * http, https, or mailto. Rejects file://, custom protocol handlers, UNC
+ * paths, javascript:/data: URIs, and relative paths (no base = throws). This
+ * is the guard for the main "untrusted text (model/web link) → native action"
+ * bridge: a markdown link like `[results](file:///C:/Windows/System32/calc.exe)`
+ * must never reach `plugin:shell|open`.
+ */
+export function isSafeExternalUrl(url: string): boolean {
+ try {
+ const proto = new URL(url).protocol
+ return proto === 'http:' || proto === 'https:' || proto === 'mailto:'
+ } catch {
+ return false
+ }
+}
+
/** Open a URL in the system's default browser (works in both dev and Tauri) */
export async function openExternal(url: string): Promise<void> {
+ if (!isSafeExternalUrl(url)) {
+ console.warn('[openExternal] blocked non-web URL:', url)
+ return
+ }
if (isTauri()) {
// Use Tauri's invoke to open URL in system browser via shell plugin
const invoke = await getInvoke()
@@ -666,10 +687,10 @@ export async function openExternal(url: string): Promise<void> {
await invoke('plugin:shell|open', { path: url })
} catch {
// Fallback if plugin command format differs
- window.open(url, '_blank')
+ window.open(url, '_blank', 'noopener,noreferrer')
}
} else {
- window.open(url, '_blank')
+ window.open(url, '_blank', 'noopener,noreferrer')
}
}
diff --git a/src/components/settings/RemoteAccessSettings.tsx b/src/components/settings/RemoteAccessSettings.tsx
index fdf346ca..22fe5973 100644
--- a/src/components/settings/RemoteAccessSettings.tsx
+++ b/src/components/settings/RemoteAccessSettings.tsx
@@ -54,9 +54,10 @@ export function RemoteAccessSettings() {
<span className="text-[0.65rem] font-medium text-gray-400">Permissions</span>
</div>
{([
- { key: 'filesystem' as const, label: 'Filesystem Access', desc: 'Agent file read/write, shell execute' },
+ { key: 'filesystem' as const, label: 'Filesystem Access', desc: 'Agent file read/write (sandboxed to the chat workspace)' },
{ key: 'downloads' as const, label: 'Downloads & Installs', desc: 'Model downloads, ComfyUI/Ollama install' },
{ key: 'process_control' as const, label: 'Process Control', desc: 'Start/stop ComfyUI, Ollama' },
+ { key: 'shell' as const, label: 'Shell & Code Execution', desc: 'Run shell commands + code from your phone. Risky — leave OFF unless you trust the network.' },
]).map(({ key, label, desc }) => (
<div key={key} className="flex items-center justify-between">
<div>
diff --git a/src/stores/remoteStore.ts b/src/stores/remoteStore.ts
index 74fe5949..6fdc2b5d 100644
--- a/src/stores/remoteStore.ts
+++ b/src/stores/remoteStore.ts
@@ -56,6 +56,10 @@ interface RemotePermissions {
filesystem: boolean
downloads: boolean
process_control: boolean
+ /** Shell + code execution over the remote bridge. Optional + default off
+ * (RCE-class; kept separate from filesystem). Older state without it reads
+ * as false. */
+ shell?: boolean
}
interface RemoteState {
@@ -112,7 +116,7 @@ export const useRemoteStore = create<RemoteState>()((set, get) => ({
mobileUrl: '',
qrPngBase64: '',
connectedDevices: [],
- permissions: { filesystem: false, downloads: false, process_control: false },
+ permissions: { filesystem: false, downloads: false, process_control: false, shell: false },
tunnelActive: false,
tunnelUrl: '',
tunnelLoading: false,