Skip to content

fix(consumer): keep the queue password out of crash traces - #33

Merged
TorstenDittmann merged 1 commit into
mainfrom
claude/project-thread-epholt
Nov 4, 2026
Merged

TorstenDittmann merged 1 commit into
mainfrom
claude/project-thread-epholt

Conversation

@TorstenDittmann

Copy link
Copy Markdown
Contributor

Requested by Torsten · project thread

Why

When the consumer starts before Appwrite has provisioned v1-reviews on NATS, it dies with an uncaught exception, and PHP prints the stack trace with every frame's arguments. On 2026-11-03 around 02:40 UTC this wrote Broker::factory('nats://appwrite...', 'v1-reviews', 'appwrite', '<first 15 characters of the NATS password>...') to Loki on fra1, nyc3, sgp1 and tor1 prod.

What

  • Broker::factory, nats, redis and filled mark the queue URL and password #[\SensitiveParameter], so a trace shows Object(SensitiveParameterValue) for them.
  • consumer.php sets zend.exception_ignore_args=1 before anything runs, so no other frame can print a credential either.
  • A BrokerTest case checks that a trace through Broker::factory names the call without the URL or password.

Checks

php -l on the changed files, and the same SensitiveParameter trace behaviour confirmed in a standalone PHP script. I could not run the PHPUnit suite here (no Docker and no PHP 8.5 in this session), so CI is the first full run.


Generated by Claude Code

A consumer that died before it read the queue printed its stack trace with
every frame's arguments, so the NATS password (cut at 15 characters) and the
queue URL landed in Loki on each production cluster when the queue was not
provisioned yet. The broker now marks the URL and password as sensitive
parameters, and the consumer turns off exception arguments altogether.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F3M7troWjCiEZycnYK98XV
Co-authored-by: Torsten Dittmann <1759475+TorstenDittmann@users.noreply.github.com>
@TorstenDittmann TorstenDittmann self-assigned this Nov 4, 2026
@hansi-codes

hansi-codes Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The consumer now disables exception argument capture before loading its dependencies, and the broker marks its URL and password parameters as sensitive. A Broker test verifies that a trace through the factory omits those credentials.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 3
File Change
apps/consumer/consumer.php Disable exception argument capture before autoloading or broker startup.
apps/consumer/src/Broker.php Mark broker URL and password parameters as sensitive across factory and helper methods.
apps/consumer/tests/BrokerTest.php Add coverage that factory exception traces omit URL and password values.

Reviewed de326e3 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Tier S · Looks good to merge. Summary

@TorstenDittmann
TorstenDittmann merged commit 023c022 into main Nov 4, 2026
4 checks passed
@TorstenDittmann
TorstenDittmann deleted the claude/project-thread-epholt branch November 4, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants