cacti icon indicating copy to clipboard operation
cacti copied to clipboard

security(plugin-object-store-ipfs): request payload logging and stack-trace responses leak internal data

Open malsomesh9 opened this issue 6 months ago • 0 comments

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-97
  • extensions/cactus-plugin-object-store-ipfs/src/main/typescript/web-services/set-object-endpoint-v1.ts:89-97
  • extensions/cactus-plugin-object-store-ipfs/src/main/typescript/web-services/has-object-endpoint-v1.ts:89-97
  • packages/cactus-core-api/src/main/json/openapi.json:452-468 documents that SetObjectRequestV1.value may contain up to 10 MiB of caller-supplied data.

Details

All three handlers do the following:

  1. Log the full request body with this.log.debug(${tag} %o, reqBody).
  2. 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 value from logs.
  • Replace res.json({ error: ex.stack }) with a stable generic error response.

malsomesh9 avatar May 04 '26 16:05 malsomesh9