Skip to content

fix(voice): don't log the client-supplied sample rate - #1425

Merged
philmerrell merged 1 commit into
developfrom
fix/voice-sample-rate-log
Oct 3, 2026
Merged

philmerrell merged 1 commit into
developfrom
fix/voice-sample-rate-log

Conversation

@philmerrell

Copy link
Copy Markdown
Contributor

Why

CodeQL's py/log-injection flagged this on the 1.26.0 release PR (#1424). It came in with the Strands 1.57 bump (#1367). VoiceAgent.send_audio logs sample_rate when it differs from the configured rate. That value comes straight off the voice WebSocket (msg.get("sample_rate", 16000) in voice_routes.py) without validation, so a client could send a string containing a newline and forge a log line.

What changed

The debug line now logs only the configured rate (Defaults.NOVA_SONIC_INPUT_RATE). The behaviour is unchanged: 1.57 fixes the sample rate in the model's audio config, and the client's value was only ever logged.

Test plan

  • pytest tests -k voice: 122 passed, 4 skipped
  • After merge, CodeQL on Release/1.26.0 #1424 no longer reports alert 904, once develop is merged into the release branch

🤖 Generated with Claude Code

CodeQL py/log-injection on the release PR: send_audio logged the
sample_rate the voice WebSocket passes through unvalidated, so a
crafted value could forge a log line. Log only the configured rate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@philmerrell
philmerrell merged commit f0e37c0 into develop Oct 3, 2026
9 checks passed
@philmerrell philmerrell mentioned this pull request Oct 3, 2026
5 tasks done
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.

1 participant