Skip to content

Instance file delete can remove the whole file store #8720

Closed
FlowFuse/nr-launcher
#634

Description

@cstns

DELETE /api/v1/projects/:id/files/_/:path with a path of // deletes the instance's entire storage directory, ff-logs included, and answers 200. Forge strips one trailing slash and passes / on, and in nr-launcher/lib/files/index.js the guard fullPath !== BASE_PATH && fullPath.startsWith(BASE_PATH) lets BASE_PATH/ through, since it's not equal to BASE_PATH but does start with it.

Found through the MCP tool in #8692, which now refuses such paths itself, but the route is still exposed. The same guard is a plain prefix match, so a sibling like storage-old would pass it too. Might be worth comparing against BASE_PATH + sep and stripping trailing separators before the check, in the other file handlers as well.

Metadata

Metadata

Assignees

Labels

area:apiWork on the platform APItype:bugSomething isn't working

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions