Skip to content

KC-1471: Prevent newline injection in connect command prompts - #2390

Open
sshrushanth-ks wants to merge 2 commits into
KC-1471from
KC-1471-int
Open

sshrushanth-ks wants to merge 2 commits into
KC-1471from
KC-1471-int

Conversation

@sshrushanth-ks

@sshrushanth-ks sshrushanth-ks commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Escape control characters instead of deleting them, and properly handle shell comments to expose multi-statement payloads in the confirmation prompt. Attackers with Can Edit on shared records could inject commands that execute silently, exfiltrating device credentials without operator visibility.

Changes

  • keepercommander/commands/connect_prompts.py:
    • Escape control chars as visible sequences (\n, \t, \xHH) instead of deleting
    • Handle shell comments (#) to prevent comment-based newline injection
  • unit-tests/test_connect_security.py:
    • Add tests for newline injection, comment handling, and control character escaping
    • Verify statement breakdown exposes multi-statement payloads

Escape control chars and handle comments to prevent hidden commands from
bypassing the confirmation prompt. Attackers with Can Edit on shared records
could exfiltrate device credentials without operator visibility.
@sshrushanth-ks
sshrushanth-ks marked this pull request as ready for review September 23, 2026 08:46
@sshrushanth-ks sshrushanth-ks self-assigned this Sep 23, 2026

This branch has not been deployed

No deployments
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