This document describes what Net Drive Tray protects, how, and where its limits are. It is written for someone assessing the tool, not as a compliance claim. Nothing here has been formally certified, and nothing in this folder should be read as a statement that the tool meets any DoD, STIG, FIPS or other formal requirement. The gaps that matter for such a requirement are listed at the end.
Three kinds of secret: a smartcard PIN, a share password, and the settings that say which servers and shares you connect to. It maps drives through the standard Windows connection call. It does not implement its own network protocol, and it does not send anything anywhere other than to the share you ask it to connect to.
PINs and passwords
- A PIN or password is typed into a field that places it straight into a .NET
SecureString. The text box only shows placeholder characters. Paste, copy, cut, caret movement and mid-text editing are disabled. - When a connection is made, the secret is copied into an unmanaged buffer for the single call to Windows and the buffer is zeroed immediately afterwards. The
SecureStringis disposed as soon as the attempt ends. - This program never saves a PIN. It is asked for every time. The prompt names the card, the server path, and the IP address that actually answered, and it is only shown after the server has answered, so the destination can be checked before anything is typed. Everything in the prompt is flattened and shortened, so a crafted drive or card name cannot rearrange the prompt or hide the server line.
- A saved password lives in Windows Credential Manager, not in the settings file. It is bound to the share path and user name it was saved for. If the settings are edited to point the same entry at a different share or user, the saved password is not released and has to be typed again.
- Secrets never appear in the audit log, the error log, error dialogs, or the "Copy details" text.
Settings and records
- The drive list is encrypted with the Windows account's own data-protection key. Another account, or a copy of the file on another machine, cannot read it. A hand-edited or damaged file fails to open instead of being trusted, and a plaintext file is never accepted. See the limits below: this does not protect against code running as you.
- The settings folder is restricted to the signed-in user and the system account.
- An audit log (
audit.login the same folder) records the time, user, event, drive name, share, sign-in method and result of every connect, disconnect, test, settings save and saved-card removal. It never contains a PIN, password, or certificate thumbprint. Entries are flattened so a crafted drive name cannot forge extra lines. It is capped at 1 MB with one older copy kept.
Input handling
- Only ordinary
\\server\share[\folder]paths are accepted, where the server is a name or an IP address. Device and extended-length forms (\\?\,\\.\), odd characters, wildcards, dot segments, line breaks and over-long names are refused. Drive letters are limited to D through Z. This is enforced where the connection is made, so an edited settings file cannot bypass it. - Server names are looked up through DNS only. A short one-word name such as
\\fileserver\shareis accepted, but only when DNS itself can resolve it. Broadcast lookups (LLMNR and NetBIOS), through which another computer on the local network could answer to a short name and receive the sign-in, are switched off for this lookup and never used as a fallback. When DNS resolves a short name, the connection is made to the full name DNS returned, and the PIN prompt shows both that name and the IP address that answered. If DNS cannot place the name, the connection stops with a plain explanation instead of falling back to anything else. - Nothing from the command line, environment or settings is ever run as code or pasted into a command.
The program itself
- Libraries are loaded from the Windows system folder only, never from the folder the exe is in, so a look-alike DLL dropped next to the exe is not loaded once the program is running. Images from network shares and low-integrity locations are refused. Legacy extension points (AppInit DLLs, global hooks) are disabled, only system fonts are used, and an invalid handle use stops the program.
- In normal running the program is blocked from starting any other program.
- The exe is built with address-space randomisation, no-execute and high-entropy layout enabled.
- Card and network questions are asked on a worker thread, so a slow or stuck card driver cannot freeze the tray, the menu, or a PIN dialog.
- "Start with Windows" only ever points at the installed copy. From any other location it refuses and says to install first. The program also warns once if it is started from Downloads, Temp or a network share.
- The installer only stops copies that are running from its own install folder, removes saved passwords by listing everything it created rather than trusting the settings file, and starts its single
cmd.execall by full path from the system folder with the current-directory lookup switched off. NetDriveTray.exe /selftestchecks, under the same restrictions as normal running, that every Windows call the program relies on still works, that the restrictions are in force, that the secret field does not leak what was typed, that the input rules hold, and that the tray app starts. It writes the result to%TEMP%\NetDriveTray-selftest.txtand changes nothing that outlasts the test.
The script version
- The launcher calls Windows PowerShell by its full path from the system folder, with the current-directory lookup switched off, so a look-alike
powershell.exedropped next to the script is not run. It ignores everything typed after the file name, so no command-line text can become a command. It does not override the execution policy. - It refuses to run unless PowerShell is in normal full-language mode. On a PC that restricts PowerShell it stops with a message (exit code 9) and does not try to get around the restriction.
- It applies the same path checks, keeps PINs and passwords as secure strings end to end, shows the same destination and address in the PIN prompt, only disconnects what it put on a drive letter, and writes the same audit log.
The design and code were reviewed by the author, then by a separate automated reviewer working read-only with a threat model and no access to the author's reasoning. Its findings were checked against the code. The ones that held were fixed: the script launcher running a planted powershell.exe and treating command-line text as commands, bare cmd.exe and ping calls in the uninstaller and self-test, short server names being resolved by broadcast lookups (now DNS only, with the connection made to the full name DNS returns), the PIN prompt being spoofable through a drive name, card calls running on the UI thread, a startup entry that could point at any location, a regex that let a trailing line break through, and the script's disconnect not checking what was on the letter. The settings-protection wording was also corrected, because it claimed more than DPAPI provides.
This is not an accredited assessment.
- Same-user malware is out of scope. Anything running as you can read your saved passwords from Credential Manager, read and rewrite the encrypted settings (they are protected by your own key), watch the screen, or record keystrokes. Encryption at rest protects against other accounts, offline copies and other machines, not against code running in your session. For the same reason the path-and-user binding on saved passwords only stops edits made by something that cannot also read Credential Manager.
- The PIN passes through the smartcard driver. This program does not save it, but it hands it to Windows, which hands it to the card's driver. Some drivers keep a PIN cached until sign-out or card removal. That is outside this program's control.
- SMB protection comes from Windows, not this tool. Whether the connection is signed or encrypted is decided by Windows and server policy. This tool cannot require it. On a managed network, SMB signing and encryption should be required by policy, and LLMNR and NetBIOS name broadcasts should also be turned off by policy for the rest of the system.
- Password sign-in sends a challenge response to whatever server the name leads to. A server reached through spoofed DNS could capture it for offline guessing. Using DNS only (no broadcast lookups) and showing the full name and address in the prompt reduce this but do not remove it; DNS itself is trusted. Prefer smartcard sign-in, and only use share paths you trust.
- The exe is not code-signed. A managed environment normally expects a trusted publisher signature. Without one the exe may be blocked by policy, and its origin cannot be verified from the file alone.
Diagnostics...in the tray menu shows whether the running copy is signed. - The installed copy is writable by you. The per-user install lives in your profile, because installing without administrator rights is a goal of this project. Malware running as you could replace the installed exe with a look-alike that shows a copy of the PIN prompt. The real protection against that is a signature plus an application-control rule that only allows the signed build to run.
- Anything the Windows loader reads before the program starts is outside its control. The library-loading restrictions are applied as the first thing
Maindoes. A configuration file placed next to the exe (NetDriveTray.exe.config) is read by the .NET runtime before that. Keep the exe in a folder only you can write to, and run it from there. - The script version is editable by design. The
.cmdfile can be changed by anyone who can write to it, and it cannot carry a signature. It also compiles a small helper in memory at run time and runs script text taken from its own file. Endpoint tools may flag that, and a PC that blocks it is making a reasonable choice. Use the exe where the script is not allowed. - The installer relies on two pieces of Windows tooling. It creates its Start-menu shortcut through the Windows scripting host, and the uninstaller's cleanup uses
cmd.exe, called by full path. - The single-instance lock can be taken by another process in the same session. That only stops the app from starting, and nothing is exposed by it.
These are outside what this project can supply:
- A code-signing certificate from the organisation's trusted authority, and signing of the exe (and a reviewed, signed script if the script version is allowed at all).
- Approval through the organisation's software review process, and an application-control rule (for example by publisher) so only the approved build runs.
- A check against the organisation's current hardening baseline (STIG or equivalent) and any cryptographic-module requirements. The app relies on Windows' own cryptography (data protection, Credential Manager, the smartcard stack) and implements none of its own, but it has not been assessed against FIPS requirements.
- Independent penetration testing by an accredited assessor and a review of the build process.
- SMB signing and encryption, name-broadcast protocols disabled, smartcard policy, and account lockout settings enforced by group policy.
Please report security problems privately. Use the Report a vulnerability button on the Security tab of the GitHub repository, which sends the report to the maintainer without making it public. Don't post details in a public issue or pull request. Include what you found, how to reproduce it and which version you tested. Fixes go into the latest release only.