Repository navigation
Overview
Tether v1.2.3 is a focused security and reliability release that introduces comprehensive hardening across the Windows Credential Provider, IPC named pipe and event infrastructure, and the session helper's application launch surface. This release also delivers automatic Microsoft Account detection with adaptive onboarding UI, resolves multiple desktop interface layout regressions, and adds persistent paired device caching for immediate visibility at launch.
New Features
Microsoft Account Auto-Detection and Adaptive UI
A new WindowsAccountDetector component automatically identifies whether the active Windows session is backed by a Microsoft Account (MSA), a local account, or a domain account at application startup.
- Win32 NetUserGetInfo Level 24 Integration: The detector calls
NetUserGetInfoat level 24 to query theUSER_INFO_24structure, extracting theusri24_internet_identityflag, the internet provider name, and the internet principal name (e.g.,user@outlook.com). Fallback detection checks theIdentityCRLregistry hive and token group SIDs when the primary call is unavailable or returns inconclusive results. - Dynamic Sidebar Identity Display: The sidebar "Current Account" card now renders a contextual badge pill ("MICROSOFT ACCOUNT", "LOCAL ACCOUNT", or "DOMAIN ACCOUNT") alongside the detected account identity. The SAM profile alias and Microsoft Account email principal are displayed as appropriate for the account type.
- Adaptive Auto-Unlock Setup: The credential vault setup card dynamically adjusts its title, description, placeholder text, and security disclaimer based on the detected account type. Microsoft Account users are prompted for their online account password with explicit guidance that Windows Hello PINs cannot be used for credential provider unlock. Local account users see standard local password prompts.
- Passwordless Microsoft Account Notice: An inline guidance panel with an external documentation link is displayed for passwordless Microsoft Account configurations (Windows Hello-only setups) explaining the limitation and directing users to set an app password.
- Pre-Save Credential Validation: Entered credentials are validated in real time against
LogonUser(Win32) before being committed to the DPAPI-encrypted store. The validator detects common mistakes including PIN entry (4-10 digit numeric strings), expired passwords (ERROR_PASSWORD_EXPIRED), disabled accounts (ERROR_ACCOUNT_DISABLED), and incorrect passwords (ERROR_LOGON_FAILURE), returning clear, account-type-aware error messages. Validation attempts multiple candidate (username, domain) pairs including MSA-specific "MicrosoftAccount" domain, SAM name with local domain, and dot-domain fallbacks, using bothLOGON32_LOGON_INTERACTIVEandLOGON32_LOGON_NETWORKlogon types. - Forgot Password Recovery Card: Account-type-aware copy is applied to the recovery flow so that Microsoft Account users are asked for their online password while local users are asked for their Windows password.
Persistent Paired Device Caching
Paired phone devices now appear immediately on application launch, even when the communication service is still starting or the phone is temporarily disconnected.
- Local Device Cache (DesktopUI): The desktop UI reads and writes a local paired device cache at
%LocalAppData%\Tether\paired_devices.json. On startup, cached device entries (including device ID, display name, fingerprint, and last-seen timestamp) are loaded and rendered in the sidebar before the service connection is established. - Public Summary Cache (TrustStore): The
TrustStorenow writes apaired_devices_cache.jsonsummary file alongside the trust data in%ProgramData%\Tether, with Authenticated Users granted read access to the trust store directory and file. This enables the non-elevated desktop UI process to read paired device state without requiring administrative privileges. - PROVISION_PHONE Event: The
PairingManagernow publishes aPROVISION_PHONEevent over the internal event bus upon successful phone pairing completion, carrying a JSON payload of all currently trusted devices. The desktop UI requests a telemetry sync with retries on startup to ensure the cache is populated.
Security
Credential Provider COM Interface Hardening
Every public COM interface method in CTetherCredential has been hardened with structured exception handling and rigorous parameter validation.
- SEH and C++ Exception Guards: The
Initializemethod is now wrapped in atry/catch(...)block returningE_UNEXPECTEDon unhandled exceptions, matching the existing pattern applied to other COM methods. This prevents unhandled C++ exceptions from propagating across the COM boundary on the secure desktop (Winlogon). - E_POINTER Validation: Null output pointer checks (
E_POINTER) have been added toSetSelected,GetFieldState,GetStringValue,GetBitmapValue,GetSubmitButtonValue,GetComboBoxValueCount,GetComboBoxValueAt,GetFieldOptions,ReportResult, andGetUserSid. Output pointers are pre-initialized tonullptrwhere applicable before any work is performed. - E_INVALIDARG Validation: The
Initializemethod now validates all three input pointers (pcpUser,rgcpfd,rgfsp) before proceeding, up from checking onlypcpUser.
Plaintext Password Memory Zeroing
All code paths that handle plaintext password buffers in the credential provider now zero memory before deallocation to prevent password remnants from persisting in the process address space.
- SetStringValue: When the password field (
SFI_PASSWORD) is overwritten, the previous buffer is zeroed withSecureZeroMemoryover its fullwcslen * sizeof(WCHAR)extent beforeCoTaskMemFree. - _PackActualPasswordCredential: Intermediate plaintext password copies are zeroed with
SecureZeroMemorybefore being freed viaCoTaskMemFree. - _GetStoredPasswordAndPack: Decrypted password buffers are zeroed after use.
- helpers.cpp / ProtectIfNecessaryAndCopyPassword: Both
pwzProtectedandpwzToProtectCopybuffers are zeroed withSecureZeroMemorybeforeCoTaskMemFree. Null checks guard against double-free on already-freed pointers.
IPC Named Event Security Overhaul
The global named events used for inter-process communication between the credential provider, the communication service, and the desktop UI (TetherPhoneAppUnlocked, TetherPhoneConnected, TetherUnlockPromptRequested) have been redesigned for a consistent "open-or-create" pattern with strengthened DACLs.
- Updated SDDL: All global IPC events now use the SDDL string
D:P(A;;GA;;;SY)(A;;GA;;;BA)(A;;GR;;;AU), granting SYSTEM and Administrators full generic access while granting Authenticated Users read-only (generic read) access. The previous SDDLD:P(A;;GA;;;SY)(A;;GA;;;BA)excluded Authenticated Users entirely, which causedUnauthorizedAccessExceptionfailures when the desktop UI (running as a standard user) attempted to open events withSynchronizerights. - TryOpenExisting Pattern (Service Side):
Worker.csandHardwareExecutor.csnow useEventWaitHandleAcl.TryOpenExistingto open pre-existing events with only the minimum required rights (Modify | ReadPermissions, orModify | ReadPermissions | Synchronize), eliminating the previous pattern of always creating events and then checkingcreatedNew. This avoids requestingWRITE_DACpermission on events owned by SYSTEM, which standard-user processes cannot obtain. - DACL Re-stamping: When an existing event is opened and passes the trusted-owner check, its DACL is re-stamped via
SetKernelObjectSecurityto enforce the current expected SDDL, ensuring that events created by older versions with weaker DACLs are upgraded in place. - Credential Provider (Native): The native C++ credential provider (
TetherCredential.cpp) applies the same "create-then-verify" pattern with the updated SDDL. TheIsTrustedKernelObjectOwnerhelper is used consistently to validate that existing events are owned by SYSTEM or Administrators before signaling. - Desktop UI (Managed):
MainWindow.xaml.csopens global unlock events viaEventWaitHandleAcl.TryOpenExistingwithSynchronize-only rights, the minimum needed to wait on the event without requiring write or modify permissions.
Named Pipe Security Hardening
All NamedPipeServerStream instances across the communication service have been updated to explicitly deny the Anonymous SID (WellKnownSidType.AnonymousSid) in addition to the existing Network SID denial.
- PipeServer:
CreatePipeSecurity()now includes an explicitDenyACE forAnonymousSidwithReadWriterights. The method visibility was changed fromprivatetointernalto support unit testing. The access rule ordering is documented with numbered comments. - InputForwarder: The input forwarding pipe security descriptor adds an explicit
AnonymousSiddeny rule. - App.xaml.cs (DesktopUI): The desktop UI's local pipe security descriptor adds the same
AnonymousSiddeny rule.
Application Launch Command Injection Prevention
ApplicationManager.LaunchApplication in the session helper has been hardened against command injection, shell metacharacter exploitation, and execution of dangerous binaries.
- Control Character Rejection: Paths and arguments containing any control characters (including null bytes, newlines, and carriage returns) are rejected.
- Shell Metacharacter Blocking: Paths and arguments containing command chaining and redirection operators (
&,|,<,>,^,;,`) are rejected. - Interpreter Blocklist: A static set of blocked binary names (
cmd,powershell,pwsh,mshta,cscript,wscript,bash,wsl,sh,reg,vssadmin) prevents direct invocation of shell interpreters and system-modifying tools, checked against both the full filename and the filename without extension. - Script Extension Blocklist: Files with dangerous executable script extensions (
.bat,.cmd,.ps1,.psm1,.vbs,.vbe,.js,.jse,.wsf,.wsh,.hta,.msc,.reg) are blocked from launch.
Shell Execution Hardening
- Browser and Settings Launch:
HardwareExecutorno longer usescmd.exe /c startto launch browser URLs or Windows Settings URIs. These are now launched directly viaexplorer.exe, eliminatingcmd.exeas an intermediary and reducing the attack surface for command injection through crafted capability payloads.
PowerCfg Argument Injection Prevention
- ProcessStartInfo.ArgumentList:
WindowsAdminManagerpowercfg invocations for battery report generation and power scheme activation have been refactored from string-basedArgumentsto the array-basedArgumentListAPI (psi.ArgumentList.Add(...)). This prevents argument injection through specially crafted power scheme GUIDs or file paths, as the runtime handles escaping and quoting automatically.
Bug Fixes
Audio Mute State Query
- get-mute Exit Code Handling:
HardwareExecutornow correctly interprets exit codes from the audio helper when theget-mutesubcommand is invoked. Previously, only exit code 0 was treated as a valid result for numeric queries. The mute state query now recognizes both exit code 0 (unmuted) and exit code 1 (muted) as valid responses, and stores the exit code directly as the numeric result. This fixes incorrect "mute state unavailable" errors when the system audio was muted.
IPC Named Event Permission Errors
- WRITE_DAC Access Denied: Opening existing named events with
EVENT_MODIFY_STATE | READ_CONTROL | WRITE_DACpermissions (as was done implicitly by the previousCreate-with-createdNewpattern) failed withACCESS_DENIEDwhen the event was owned by SYSTEM and the caller was a standard user process. The newTryOpenExistingpattern requests only the minimum required rights, resolving sporadicUnauthorizedAccessExceptionerrors during service startup and event signaling.
Desktop UI Layout Corrections
- Sidebar Column Width: The sidebar navigation column has been widened from 236px to 260px to accommodate Microsoft Account email addresses and the new account type badge pill without truncation.
- Account Card Typography: Font sizes, padding, and margins in the user account card have been adjusted (font size reduced from 9.5 to 8.5 for the "CURRENT ACCOUNT" label, card margins tightened from 12px to 10px, inner stack margin from 10px to 9px) to prevent text crowding when longer email addresses are displayed.
- CardVault Security Banner: The lock icon and descriptive text in the credential vault setup card no longer overlap.
Grid.Columnassignments have been corrected andTextWrappinghas been enabled on the description text block. - Paired Phones Section Visibility: Vertical margins on the Microsoft Account card and surrounding elements have been streamlined to ensure the "Paired Phones" section remains visible within the viewport without excessive scrolling.
Test Coverage
Native Test Suite (C++)
Test_CredentialProvider_Initialize_NullArgs_Rejected: Verifies thatCTetherCredential::InitializereturnsE_INVALIDARGwhen called with nullrgcpfd,rgfsp, orpcpUserpointers.Test_CredentialProvider_COM_PointerChecks: Comprehensive null-pointer validation test coveringSetSelected,GetFieldState,GetStringValue,GetBitmapValue,GetSubmitButtonValue,GetComboBoxValueCount,GetComboBoxValueAt,GetFieldOptions,ReportResult, andGetUserSid. Each method is verified to returnE_POINTERwhen called with null output parameters.Test_CredentialProvider_SetStringValue_ZeroesOldPassword: End-to-end test using aMockCredentialProviderUserthat initializes a credential, sets a password, verifies it viaGetStringValue, then overwrites it and verifies the new value is returned correctly, confirming that the zeroing and replacement logic does not corrupt field state.
.NET Test Suite (xUnit)
EventSecurityDescriptor_AllowsSystemAndAdminsFullControl_AndAuthenticatedUsersReadOnly: Updated to validate the new three-ACE SDDL structure with exact ACE string assertions ((A;;GA;;;SY),(A;;GA;;;BA),(A;;GR;;;AU)) and confirms the absence of Anonymous (AN) and Everyone (WD) SIDs.PipeServerSecurity_DeniesNetworkAndAnonymous_AllowsLocalSystemAndAdmins: New test that instantiates the productionPipeServer.CreatePipeSecurity()method and iterates all access rules to verify that Network and Anonymous SIDs are denied, SYSTEM and Administrators are allowed, and Authenticated Users are allowed.ApplicationManagerTests: New test class with three theory-based test methods:LaunchApplication_RejectsControlCharacters: Verifies rejection of paths containing newlines, tabs, null bytes, and embedded control sequences.LaunchApplication_BlocksShellInterpreters: Verifies rejection ofcmd.exe,powershell.exe,pwsh.exe,mshta.exe,cscript.exe,wscript.exe,bash.exe,wsl.exe, and their extensionless variants, including fully qualified paths.LaunchApplication_BlocksScriptExtensions: Verifies rejection of files with.bat,.cmd,.ps1,.psm1,.vbs,.hta, and.regextensions.
Infrastructure
- Version Bumps: Installer (
Tether.iss) updated from1.2.1to1.2.3. Android companion app (build.gradle.kts) updated from version name1.2.2/ version code4to version name1.2.3/ version code6. - PipeServer Visibility:
CreatePipeSecurity()changed fromprivatetointernalto enable direct unit testing of the pipe security descriptor construction.
Files Changed
| Component | Files Modified | Lines Added | Lines Removed |
|---|---|---|---|
| Credential Provider (C++) | TetherCredential.cpp, helpers.cpp |
~350 | ~290 |
| Desktop UI (WPF) | MainWindow.xaml, MainWindow.xaml.cs, App.xaml.cs, WindowsAccountDetector.cs (new) |
~700 | ~215 |
| Communication Service | HardwareExecutor.cs, WindowsAdminManager.cs, PipeServer.cs, InputForwarder.cs, Worker.cs, TrustStore.cs, PairingManager.cs |
~970 | ~900 |
| Session Helper | ApplicationManager.cs |
~46 | 0 |
| Tests | main.cpp, ApplicationManagerTests.cs (new), GlobalNamedEventTests.cs |
~265 | ~7 |
| Build/Installer | Tether.iss, build.gradle.kts |
~4 | ~4 |
| Total | 19 files | ~2,428 | ~1,299 |
Upgrade Notes
- This release requires no configuration changes. All security hardening is applied automatically on upgrade.
- Existing global IPC events created by v1.2.2 or earlier will have their DACLs upgraded in place on first access by the v1.2.3 service or credential provider.
- The
paired_devices_cache.jsonfile in%ProgramData%\Tetherwill be created automatically on the next trust store write operation. - The
paired_devices.jsonfile in%LocalAppData%\Tetherwill be created automatically by the desktop UI on first successful paired device sync.