Skip to content

Comprehensive Security Hardening, Credential Provider Isolation, and Protocol Remediations

Choose a tag to compare

@tirthsaraiya29 tirthsaraiya29 released this 05 Nov 12:08
· 153 commits to main since this release

Overview

Tether version 1.1.4 delivers critical architectural, security, and usability remediations across the entire Tether ecosystem, encompassing the Windows background service, native Credential Provider DLL, Session Helper, Desktop UI, Android companion application, and Inno Setup installer.

Key highlights include strict per-instance tile isolation in Windows LogonUI, DPAPI machine-level vault encryption, named pipe access control hardening with Network SID rejection, unique lock session tracking on Android, sequential touch input queues, and enhanced pairing rate limiting with real-time feedback.


Key Changes & Improvements

1. Windows Credential Provider & Logon UI Isolation

  • Per-Instance State Synchronization: Replaced global state triggers with atomic instance flags (_fInstancePhoneAppTriggered, _fInstanceAutoLogonReady) in CTetherCredential, preventing tile starvation and race conditions in multi-account login environments.
  • Target User SID Validation: Bound remote unlock requests directly to the configured TargetUserSid in registry secrets. SID validation performs account lookups via LookupAccountNameW and ConvertSidToStringSidW with fallbacks for domain-joined accounts.
  • LogonUI Filter Clean-up: Removed erroneous ICredentialProvider registration entries under the Windows Credential Provider Filters registry key in both register.reg and Tether.iss, preventing potential LogonUI.exe stability issues.

2. Inter-Process Communication & Secrets Hardening

  • Named Pipe Access Restrictions: Implemented explicit NetworkSid DENY access rules on \\.\pipe\TetherIPC to prevent remote or cross-network named pipe exploitation. Client process credentials and session contexts are verified via RunAsClient.
  • IPC Event Whitelisting: Prohibited unauthorized state-injection payloads (PHONE_UNLOCKED, AUTH_SUCCESS) over IPC pipes, enforcing an allowlist restricted to authorized client actions (PANIC_TRIGGERED, HARDWARE_SYNC_REQUESTED, FORGET_PHONE, VAULT_UPDATE).
  • DPAPI Machine-Level Vault Storage: Refactored TrustStore to use Windows Data Protection API (ProtectedData.Protect under DataProtectionScope.LocalMachine). Writes are performed atomically using temporary files with inheritance-stripped DACLs restricted to SYSTEM and Administrators.
  • Zero Command-Line Credential Leakage: Eliminated command-line credential passing in Tether.DesktopUI. Vault updates are now securely piped across redirected standard input via --commit-vault-stdin.

3. Session Management & Input Injection

  • Least-Privilege Process Querying: Replaced elevated process query tokens with PROCESS_QUERY_LIMITED_INFORMATION in Tether.SessionHelper, allowing standard user processes to reliably locate the Session 0 service.
  • Locked-State Input Suppression: Updated InputInjector to verify workstation lock status and suppress virtual mouse and keyboard injection while the console is locked.

4. Pairing Protocol & Rate Limiting

  • PIN Retry Policy: Expanded pairing retry attempts to a maximum of 3 failed entries before closing the handshake. Packets transmit PAIRING_INVALID_PIN with the count of remaining attempts.
  • PIN Privacy: Stripped plaintext PIN values from internal event bus distribution; the PIN is surfaced strictly to the active console session via WTSSendMessage.
  • Concurrency Guards: Added SemaphoreSlim synchronization to the Desktop UI pairing handler to eliminate concurrent dialog collisions.
  • mDNS Certificate Resolution: Embedded {hostname}.local Subject Alternative Name (SAN) records in generated self-signed TLS certificates to ensure smooth local host resolution.

5. Android Companion Application

  • Lock Session Isolation: Addressed notification deadlock by scoping unlock notifications to a unique lockSessionId (UUID) per lock event. Clearing dismissals on WTS_SESSION_UNLOCK ensures future lock events prompt the user reliably.
  • Notification Cleanup: Active unlock notifications are automatically cancelled as soon as the workstation is unlocked locally or remotely.
  • Sequential Touch and Gesture Pipeline: Migrated sendInputFrame from unbounded parallel coroutines to a sequential coroutine Channel<ByteArray>, preventing out-of-order mouse and touch packet delivery over Wi-Fi.
  • Subnet-Directed Discovery: Enhanced TetherDiscoveryManager to iterate over all active network interfaces and broadcast discovery packets to subnet-directed broadcast addresses alongside 255.255.255.255.
  • Pairing Interface: Refactored PairingConfirmationActivity to display live remaining PIN attempts without dismissing the dialog on invalid entries.
  • UI Feedback: Added charging indicator animations within LaptopScreenCard.

6. Packaging & Build Automation

  • Installer Updates: Updated Inno Setup installer script (Tether.iss) to v1.1.4. Removed obsolete 32-bit Visual C++ redistributable requirements.
  • Data Retention Guard: Added an uninstallation prompt enabling users to preserve secure vault pairings across re-installations.
  • Logging Standardization: Standardized runtime logs to rolling files placed in %ProgramData%\Tether\logs.
  • Repository Hygiene: Updated .gitignore to prevent tracking of local build scripts, binary artifacts, and signing keys.

Commit Summary

  • dd28a67 - chore: add binaries, build scripts to .gitignore and bump installer version
  • fa6e1d2 - fix(core): comprehensive architectural, security, and usability remediations

File Change Statistics

  • Total Files Changed: 34
  • Additions: +1,084 lines
  • Deletions: -219 lines