T09 · Insecure Skill Coding Practices
- Location
execute.py:557- Finding
Attacker-Controlled Executable Path Enables Arbitrary Code Execution
- Content
View full analysis
Vulnerability Details
File Location:
execute.py:557-563; execution sink atservices/file_convert_service.py:82-96
Vulnerability Type: Untrusted executable selection
Risk Level: CriticalCode Snippet
python convert_tool = params.get( 'libreoffice_path', r"D:\Program Files\libreoffice\program\soffice.exe" ) success = MutualConver._convert_with_libreoffice_fast( pdf_info['path'], docx_path, convert_tool, 'docx' )python cmd = [ convert_tool, "--headless", "--convert-to", output_format, "--outdir", output_dir, input_path ] process = subprocess.Popen( cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, creationflags=subprocess.CREATE_NO_WINDOW )Technical Analysis
The
libreoffice_pathrequest parameter is accepted without an allowlist, canonical-path validation, trusted-directory restriction, or executable identity verification. It is then used as the first argument tosubprocess.Popen.Using an argument array prevents shell metacharacter injection, but it does not prevent execution of an attacker-selected local program. If an attacker can reference an existing executable or place an executable in a location accessible to the service, the program will run with the privileges of the Skill process.
Attack Path
- The attacker places or identifies a malicious executable accessible to the service account.
- The attacker invokes
invoice_extractwith at least one PDF file. - The attacker supplies the malicious executable path in
libreoffice_path. handle_invoice_extractpasses the path to_convert_with_libreoffice_fast.subprocess.Popenlaunches the attacker-selected executable.- The executable runs with the Skill process's filesystem and operating-system permissions.
Impact Assessment
Successful exploitation permits arbitrary local code execution under the service ...[truncated 242 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove
libreoffice_pathfrom user-controlled request parameters. - Configure the executable path through an administrator-managed, read-only configuration.
- Resolve and canonicalize the configured path before use.
- Require the executable to reside in a trusted installation directory.
- On Windows, verify the executable's Authenticode signature and expected publisher.
- Reject executables located in upload, temporary, user-profile, or other writable directories.
- Run conversion in an isolated, low-privilege worker with restricted filesystem access.
- Remove
