Validate sink names and descriptions to prevent config injection - #8
Merged
SimplyJustJessie merged 1 commit intoJul 19, 2026
Conversation
Two defense-in-depth gaps in the v2 virtual-sink code: - IsValidDescription only rejected the two quote styles. A description is embedded in the pipewire-pulse drop-in as the double-quoted value of a single-line `args = "…"` string, so a newline (easily pasted in the create-sink field) breaks that value and — since all sinks share one pulse.cmd block — fails every declared sink at boot; a backslash collides with SPA-JSON's \" / \\ escaping. Reject backslashes and control characters too. - The load path (RuleStore) only normalized shape, not content, so a hand-edited rules.json could feed an unvalidated name straight into the pactl argv (module-arg injection) and the generated drop-in, and a null name would throw from the reconciler's name-keyed sets and disable sink reconcile every pass. Sanitize on load: drop specs with an unusable name, fall back to the name for an unusable description. The cleaned shape persists on the next save. Adds SinkNameValidatorTests and a RuleStore sanitization test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019fY8PWVacBF6mjfmBmVPnU
SimplyJustJessie
pushed a commit
that referenced
this pull request
Aug 24, 2026
…nger exists' (#8) from claude/autostart-self-heal into main Reviewed-on: https://git.bussy.cloud/jessie/AutoRoute/pulls/8
SimplyJustJessie
deleted the
claude/branch-perf-security-analysis-tjvkdb
branch
August 24, 2026 09:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add comprehensive validation for virtual sink names and descriptions to prevent injection attacks and configuration corruption. This includes stricter validation rules, sanitization of hand-edited configuration files, and new test coverage.
Key Changes
Enhanced
SinkNameValidator:Configuration Sanitization in
RuleStore:SanitizeVirtualSinks()method that validates all virtual sinks when loading rules.jsonComprehensive Test Coverage:
SinkNameValidatorTestsclass with theory tests for valid/invalid names and descriptions=for module args, quotes for SPA-JSON/shell escaping, backslashes for JSON escaping, and control characters that break the drop-in formatHand_edited_virtualSinks_are_sanitized_on_load()verifies the sanitization pipeline handles tampered configuration files gracefullyImplementation Details
The validation prevents multiple attack vectors:
=could smuggle extra module arguments into pactl argvsink_propertiesvalue; double quotes close the drop-in'sargsstring\\and\"escapingargs = "…"value, causing all declared sinks to fail at bootThe sanitization approach is defensive: even if the UI and importer validate correctly, a hand-edited rules.json file can still carry invalid data. Rather than failing to load, the store sanitizes on load and logs warnings, ensuring the system remains operational.
https://claude.ai/code/session_019fY8PWVacBF6mjfmBmVPnU