Class WorkspaceScopeQuery
- Namespace
- Kuestenlogik.Bowire.Endpoints
- Assembly
- Kuestenlogik.Bowire.dll
The ?workspaceId= / ?storageRoot= pair every per-workspace
endpoint reads, validated once.
public static class WorkspaceScopeQuery
- Inheritance
-
WorkspaceScopeQuery
- Inherited Members
Remarks
Both values end up in a file path, and both arrive from a query string —
which CodeQL flagged as cs/path-injection and which is simply true:
nothing between the browser and Path.Combine was checking them.
Six endpoint files read this pair, so the check belongs here rather than
six times over, where the seventh would be the one that forgot.
The threat is not hypothetical even for a tool bound to loopback. A page
in any tab can POST to localhost, and Bowire's own workbench runs
scripts from the target APIs it renders. "It only listens locally" bounds
who can reach it, not what a request can ask for once it does.
Public because the endpoints that read this pair are no longer all in core: a rail package contributing a workspace-scoped route needs the same check, and the alternative — a second copy of it out there — is how a security rule comes to differ from itself.
Methods
From(HttpContext)
Read and validate the pair from a request.
public static BowireWorkspaceScope From(HttpContext ctx)
Parameters
ctxHttpContext
Returns
Validate(string?, string?)
The rules, separated from HttpContext so they can be exercised directly.
public static BowireWorkspaceScope Validate(string? workspaceId, string? storageRoot)