Summary
PACSgear PACS Scan 5.2.1 exposes an unauthenticated .NET Remoting TCP service that allows remote attackers to read and write arbitrary files on the host.
By abusing this file write primitive with DLL hijacking in a service that runs as NT AUTHORITY\SYSTEM, an attacker can achieve full remote code execution after a service restart.
Affected context
This vulnerability appears in PACSgear PACS Scan 5.2.1 deployments where the PGImageExchQueue.exe .NET Remoting TCP service is reachable on port 22222.
Systems that expose this port on internal networks or, more critically, to external networks are at risk, particularly when the service lacks authentication or access controls.
The issue is most impactful on hosts where PGImageExchangeQueueSvc.exe runs with elevated privileges and loads DLLs from the application directory during startup.
Exploit preconditions
- Attack surface: Network-accessible .NET Remoting TCP service on port 22222
- Required access: Ability to connect to the PGImageExchQueue.exe service over TCP; no prior authentication required
- Trigger point: Invocation of remoting methods that permit arbitrary file read/write operations in the application directory or other accessible paths
- Why exploitation is possible: The remoting endpoint does not enforce authentication (CWE-306), and the service trusts incoming serialized data structures (related to CWE-502), enabling arbitrary file manipulation that can be combined with DLL search order behavior for code execution
Why this happens
At its core, the vulnerability stems from an exposed remote service that fails to enforce any authentication or authorization checks before accepting and processing client requests, aligning with CWE-306: Missing Authentication for Critical Function.
The .NET Remoting TCP service allows operations that result in arbitrary file reads and writes, effectively granting file system control to any network client reaching port 22222.
This is compounded by a DLL loading pattern in PGImageExchangeQueueSvc.exe where missing DLLs such as CRYPTSP.DLL are loaded from the application directory, a classic DLL hijacking scenario.
Together, these behaviors form an insecure design where unauthenticated remote calls can implant a malicious DLL that will later be loaded by a privileged Windows service, culminating in system-level remote code execution.
Potential impact
- Remote attackers may gain arbitrary file read access, potentially exposing sensitive medical data or system configuration files.
- Remote attackers can write arbitrary files, including planting malicious DLLs or modifying application configuration.
- Attackers could achieve remote code execution as NT AUTHORITY\SYSTEM when the vulnerable service restarts and loads the hijacked DLL.
- Compromise of the underlying Windows host, enabling lateral movement across the healthcare network.
- Integrity and availability impacts on clinical workflows that rely on PACS Scan integration.
General mitigation guidance
Effective mitigation focuses on reducing exposure of critical remote services and hardening how privileged components load external resources.
Common defensive patterns include:
- Enforcing strong authentication and authorization on all remote management or data exchange interfaces, especially .NET Remoting endpoints.
- Restricting or eliminating functionality that allows arbitrary file write operations from remotely supplied data.
- Configuring services to load DLLs from secure, system-controlled paths only, avoiding application-directory search behavior where possible.
- Running services with least-privilege accounts instead of NT AUTHORITY\SYSTEM, reducing the blast radius of any compromise.
- Limiting network access to port 22222 with firewall rules, VPNs, or application-layer gateways so only trusted hosts can connect.
- Adopting secure-by-default settings where remote interfaces are disabled or locked down unless explicitly needed.
How teams detect issues like this
Organizations can detect and manage this class of vulnerability using multiple complementary approaches:
- Network security monitoring to identify unexpected inbound connections to port 22222 and anomalous usage of .NET Remoting services.
- Static analysis or manual code review of remote service implementations to flag missing authentication checks, broad file operation APIs, and trust of serialized inputs.
- Configuration and policy reviews ensuring privileged Windows services do not load DLLs from writable application directories and adhere to strict search paths.
- Host-based intrusion detection to monitor for creation of suspicious DLLs in application directories and changes to service binaries.
- Regular security assessments and penetration tests focusing on legacy remoting technologies and elevated services in medical imaging and PACS environments.

