cacti
cacti copied to clipboard
security(plugin-object-store-ipfs): request payload logging and stack-trace responses leak internal data
Summary
The IPFS object-store web service endpoints both log request payloads and return raw stack traces in HTTP 500 responses.
Affected code
extensions/cactus-plugin-object-store-ipfs/src/main/typescript/web-services/get-object-endpoint-v1.ts:89-97extensions/cactus-plugin-object-store-ipfs/src/main/typescript/web-services/set-object-endpoint-v1.ts:89-97extensions/cactus-plugin-object-store-ipfs/src/main/typescript/web-services/has-object-endpoint-v1.ts:89-97packages/cactus-core-api/src/main/json/openapi.json:452-468documents thatSetObjectRequestV1.valuemay contain up to 10 MiB of caller-supplied data.
Details
All three handlers do the following:
- Log the full request body with
this.log.debug(${tag} %o, reqBody). - Return
res.json({ error: ex.stack })on unhandled exceptions.
For setObjectV1, the logged request body includes the caller-provided value field, which the OpenAPI schema allows to hold arbitrary content up to 10 MiB. That means application data can be copied into logs, and internal stack traces are also reflected back to clients.
Expected behavior
- Request logging should avoid dumping full object payloads, especially
SetObjectRequestV1.value. - HTTP 500 responses should use a sanitized error payload and should not include
ex.stack.
Suggested fix
- Log only safe metadata such as route, key, and request identifiers.
- Redact or omit
valuefrom logs. - Replace
res.json({ error: ex.stack })with a stable generic error response.