Mercurial HgWeb Server (hgweb.exe)
hgweb.exe is the Windows executable that runs Mercurial's built-in web interface, hgweb. It enables HTTP access to Mercurial repositories, allowing users to browse changesets, read repository data, and perform operations via a browser or API client. This component is part of Mercurial installations and can be run standalone or behind a reverse proxy for remote access.
hgweb.exe hosts the hgweb application by loading Mercurial libraries into a lightweight Python-based HTTP server. It uses hgweb.config to locate repositories, apply permissions, set hooks, and define ports, then serves content to clients through HTTP(S) requests.
hgweb.exe is safe when obtained from official Mercurial distributions and executed within a trusted, controlled Windows environment. It operates within the Mercurial installation folder, accesses only configured repository paths, and relies on standard Windows security mechanisms. If the binary originates from the official Mercurial project and matches expected hashes, it represents a legitimate component of the Mercurial web interface.
In legitimate Mercurial deployments, hgweb.exe is not a virus. However, an executable named hgweb.exe that is downloaded from an untrusted source or appears in an unexpected directory could be malicious. Always verify provenance, signatures, and integrity before allowing network exposure of this binary.
Red Flags: If hgweb.exe is located in a temporary folder, lacks a valid digital signature, or differs from the hash in official Mercurial releases, treat as suspicious and isolate the host until provenance is confirmed.
Reasons it's running:
hgweb.exe is the Windows executable that runs Mercurial's built-in web interface (hgweb) to serve repositories over HTTP.
Yes, when sourced from official Mercurial packages and run in a trusted environment. Verify signature and path to avoid rouge binaries.
You can stop the process via Task Manager or stop the hgweb-related Windows service. If you use a reverse proxy, disable that proxy temporarily as needed.
By default hgweb may bind to port 8000 unless configured otherwise in hgweb.config or startup options.
Use a reverse proxy (Nginx, IIS, or Apache) with TLS termination in front of hgweb to encrypt traffic to clients.
High load from many concurrent requests or heavy repository operations can cause CPU spikes. Distribute load, tune timeouts, or optimize proxy settings.