mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 23:33:12 +09:00
Fix /api/plugins leaking filesystem paths
Replace PluginWebApi's requirePath member with npmPackage which is only populated if the package is not marked as private and the requirePath matches the name. This prevents the public /api/plugins endpoint from leaking filesystem paths into the controller.
This commit is contained in:
1 parent
42ae4d6897
commit
90a88f7e01
7 files changed
+19
-8
No files matched your search
@@ -59,8 +59,7 @@ function GenerateHostTokenButton() {
|
||||
}
|
||||
}, [open]);
|
||||
|
||||
// Only install plugins that aren't filesystem paths. Npm modules have max 1 forward slash in their name.
|
||||
const pluginString = pluginList.map(p => `"${p.requirePath}"`).filter(x => x.split("/").length <= 1).join(" ");
|
||||
const pluginString = pluginList.filter(p => p.npmPackage).map(p => `"${p.npmPackage}"`).join(" ");
|
||||
return <>
|
||||
<Button
|
||||
onClick={() => { setOpen(true); }}
|
||||
|
||||
Reference in new issue
Block a user