Summary
OpenEMR's RingCentral RCFaxClient can use an attacker-controlled file path when disposing of documents, allowing authenticated attackers to access files outside the intended location. Depending on the action and filesystem permissions, this may expose sensitive data or allow files to be written where the web server can execute them.
Affected context
The issue occurs in the disposeDocument() method of the RingCentral RCFaxClient in the oe-module-faxsms module. It is relevant when the module processes requests using the file_path parameter without adequately restricting which filesystem locations can be accessed. The reported download and setup actions can expose files or write content, subject to the application's permissions and server configuration.
Exploit preconditions
- Attack surface: The RingCentral fax client functionality in the
oe-module-faxsmsmodule - Required access: An authenticated account able to reach the relevant functionality
- Trigger point: Processing of a request that invokes
disposeDocument()with afile_pathvalue - Why exploitation is possible: The supplied path can escape the intended storage area; file access or execution depends on filesystem permissions and web-server configuration
Why this happens
The underlying bug is improper control of a file name or path, corresponding to CWE-73: External Control of File Name or Path. The application uses a request-influenced path for file operations without sufficiently constraining it to an intended directory. This can permit path traversal during reads or writes.
Potential impact
- Attackers may read credentials, source code, or other files accessible to the application process.
- Attackers may overwrite or create files in locations writable by the application.
- If written content is placed in a web-accessible location and the server executes it, the issue could lead to code execution.
- Exposure or modification of application files could affect confidentiality, integrity, and service availability.
General mitigation guidance
Defensive approaches commonly include avoiding direct use of user-supplied paths for filesystem operations and mapping user choices to server-controlled identifiers instead. Where paths are necessary, resolve them against a fixed base directory and verify that the resolved location remains within that directory. Apply strict input validation, minimize the application's filesystem permissions, and prevent uploads or generated files from being placed in executable web directories.
How teams detect issues like this
Review file operations in fax and document-handling code for paths derived from request parameters, especially paths passed to read, write, or file-disposal functions. Static analysis can flag user-controlled values reaching filesystem APIs; code review can check for canonicalization and containment checks. Enforce policies that limit writable directories and prevent executable content from being served from document storage, and monitor for unusual file access or creation by the application process.

