UrlBridge

UrlBridge lets a web page open a local program on Windows through a custom URL protocol, for example bridge-rdp://pc0042 → mstsc.exe /v:pc0042. Which protocols exist, which program each one starts and which values are allowed is defined by an administrator in a single configuration file. Everything that arrives in a link is treated as hostile input: it is validated strictly, it can only fill placeholders in fixed arguments, and nothing starts without your confirmation.

Feedback and bug reports are welcome as issues; please report security problems as described in SECURITY.md. Not affiliated with or endorsed by Microsoft. Windows is a trademark of the Microsoft group of companies.

Confirmation dialog of UrlBridge showing the program and its arguments

Features

Installation

Download UrlBridge-<version>-windows-x64.zip from Releases and extract it. Installation requires administrator rights; UrlBridge is always installed for all users.

The program is not signed, so SmartScreen or your antivirus may warn. The ZIP has a .sha256 file to verify the download, and the release notes link a VirusTotal scan. Changes are listed in the changelog.

  1. Write your configuration based on UrlBridge.example.json (see Configuration).
  2. Run the installer from an elevated Windows PowerShell:
powershell.exe -ExecutionPolicy Bypass -File .\Install.ps1 -ConfigPath .\UrlBridge.json

The script

The messages of the scripts are English.

Run it again to apply a changed configuration or to update the program. Uninstall.ps1 removes the program, its protocols, the event log source and the entry under Settings → Apps, which runs the same script.

Both scripts also work from a 32-bit host such as a software distribution client; they restart themselves in 64-bit PowerShell.

Exit codes of the scripts

CodeMeaning
0Success
1No administrator rights or invalid parameters
2Configuration invalid (--validate failed)
3Copying failed
4Registration failed, e.g. the protocol belongs to another program

Usage

Clicking a link such as bridge-rdp://pc0042 in the browser starts UrlBridge. It shows a confirmation with the protocol, program and arguments; the program starts only after you confirm. Cancel is the default button. If the link is rejected, the target program is missing or the configuration is invalid, a short message says so and nothing starts.

From a console:

CommandEffect
UrlBridge.exe <url>Validate, ask for confirmation, start
UrlBridge.exe --test <url>Show the program and arguments that would be started, start nothing
UrlBridge.exe --validateCheck the whole configuration and list all problems
UrlBridge.exe --versionShow the version
UrlBridge.exe --helpShow the help; without parameters UrlBridge does nothing else

UrlBridge is a window application, so a console does not wait for it. In scripts, use Start-Process -Wait -PassThru and read ExitCode:

CodeMeaning
0Started, or check passed
1Invalid command line
2Configuration invalid or unsafe (permissions)
3Link rejected
4Cancelled by the user
5Program not found or could not be started

Browser prompts

Edge and Chrome ask before opening an external protocol ("This site is trying to open UrlBridge"). To skip that prompt for trusted sites, set the browser policy AutoLaunchProtocolsFromOrigins by group policy (ADMX templates for Edge and Chrome), for example:

[{ "protocol": "bridge-rdp", "allowed_origins": ["https://intranet.example.com"] }]

The policy applies per protocol and per origin; protocols that are not listed keep the browser prompt. The install script deliberately does not set browser policies. UrlBridge still asks for confirmation before every start.

Languages

UrlBridge comes in 38 languages, among them English, German, French, Spanish, Chinese, Japanese, Arabic and Hebrew (right to left); LANGUAGES.md lists all of them with their codes. It follows the Windows display language of the user and falls back to English. To use one language for everyone, set "language": "de" in the configuration.

The dialogs, messages and console output are translated. Details reported by --validate and the entries in the event log are always English, so that they read the same on every computer.

The translations were generated by Claude (AI); LANGUAGES.md and the header of each file show which ones a person has checked. If you notice a mistake or know a better wording, please open an issue or a pull request. Reviewers are credited with their GitHub name in the language file and in LANGUAGES.md, if they agree.

The texts are plain text files in the lang folder next to the program, named after the language code, e.g. de.lang, with one key = text per line. To add a language, copy lang/en.lang, translate the texts after the = and keep the keys and placeholders such as {name}. Missing texts are taken from the fallback language (language.fallback), otherwise from English, which is built into the program. A language file is only used if standard users cannot modify it; otherwise UrlBridge ignores it and --validate warns.

Configuration

The configuration is C:\Program Files\UrlBridge\UrlBridge.json; its location cannot be changed. UTF-8 without BOM, at most 64 KiB, at most 64 protocols with 32 arguments and 8 parameters each.

{
  "protocols": [
    {
      "scheme": "bridge-rdp",
      "name": "Remote Desktop",
      "program": "C:\\Windows\\System32\\mstsc.exe",
      "arguments": ["/v:{host}"],
      "parameters": [
        { "name": "host", "type": "host" }
      ]
    }
  ]
}

If the configuration is invalid or unsafe, nothing starts, not even the protocols that are correct. Every call runs the same check as --validate.

A target program that does not exist on a computer is not an error of the configuration: --validate only warns, the other protocols keep working, and a link to the missing program shows a message that it was not found.

The parser is strict: duplicate keys, unknown fields, comments, trailing commas and missing required fields are errors.

FieldRequiredRules
languagenoLanguage code such as de or en for all users; without it UrlBridge follows the Windows display language
protocols[].schemeyesLowercase letters, digits, -, ., +; starts with a letter; 3–64 characters; unique; never a well-known scheme such as http, https, file, mailto or ms-*; must not start with url, because Windows does not open such protocols
protocols[].nameyes1–64 characters; shown in the confirmation dialog and in the registry
protocols[].programyesAbsolute path to an .exe, local (C:\…) or UNC (\\server\share\…). Local programs must be on a fixed drive. Not allowed: mapped drive letters, environment variables, .., \\?\, \\.\
protocols[].argumentsyesFixed arguments; {name} placeholders only for declared parameters, each parameter used at least once
protocols[].parametersyesOrdered list; defines number and order of the values in the link
parameters[].nameyesLetters and digits, starts with a letter, 1–32 characters
parameters[].typeyesSee value types
parameters[].min, maxfor integerAllowed range, 0–4294967295
parameters[].maxLengthfor token1–256
parameters[].valuesfor choiceFixed list of 1–64 allowed values

scheme://value1/value2/…

Value types

TypeAllowed
hostnameDNS name: A–Z a–z 0–9 - .; labels 1–63, total 1–253 characters; no - at the start or end of a label; no empty labels
ipv4Four decimal numbers 0–255 without leading zeros
hosthostname or ipv4
integerDecimal number without sign or leading zeros, within min–max
tokenA–Z a–z 0–9 - _, length 1–maxLength
choiceExactly one of values (case-sensitive)

Regardless of the type, a value consists only of A–Z a–z 0–9 - _ ., has 1–256 characters and never starts with -. Spaces, quotes, slashes, backslashes, %, control characters and anything outside ASCII are always rejected. Values can therefore neither break out of an argument nor add options of their own.

How it works

Windows starts UrlBridge.exe "<link>" for every link to a registered protocol. Each call is a separate short process: load and check the configuration and permissions, parse and validate the link, build the argument list, check the target program, ask for confirmation, start the program, write an event log entry, exit. There is no background process and no communication between processes.

Threat model

Starting programs

Permission check

On every call and during --validate, for the configuration, UrlBridge itself and local target programs; the program of the called protocol is checked again right before the confirmation.

Event log

Source UrlBridge in the Application log, with the Windows user of the call. There is no log file.

Event IDLevelMeaning
1InformationProgram started (protocol, program, arguments, link)
2InformationCancelled by the user
3WarningLink rejected, with reason
4ErrorConfiguration invalid, nothing started
5ErrorProgram not found or could not be started

Privacy

UrlBridge has no network access of its own. It sends and retrieves nothing and does not check for updates. Programs on network shares are read by Windows like any other file. The event log records the Windows user, the protocol, the values and the program of each call.

License

MIT

Release packages include THIRD-PARTY-LICENSES.txt with the licenses of all third-party components built into UrlBridge. The CI fails if a dependency uses a license that is not on the allow list in scripts/third_party_licenses.py.