Summary
A remotely reachable backup handler in DrayTek Vigor2960 may allow path traversal through its option argument. If the endpoint is accessible and the argument is not safely constrained, an attacker could reach files or paths outside the intended backup location; public exploit code has been reported.
Affected context
The issue is reported in DrayTek Vigor2960 version 1.5.1.6, in the sub_1E084 function of /cgi-bin/mainfunction.cgi?action=doWebBackup. It concerns how the backup handler processes the option argument. Risk depends on the endpoint being reachable and on the device's handling of the supplied path.
Exploit preconditions
- Attack surface: The device's web CGI backup endpoint
- Required access: Network access to invoke the endpoint; whether authentication is required is not specified in the available description
- Trigger point: Processing of the
optionargument by the backup handler - Why exploitation is possible: The argument may be used to construct or select a path without adequate restriction, allowing traversal beyond the intended directory
Why this happens
The underlying issue is path traversal, mapped to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'). This class of bug occurs when externally influenced path information is accepted without canonicalization and enforcement that the final path remains within an approved directory.
Potential impact
- An attacker may access files outside the intended backup path, subject to device permissions and handler behavior.
- Files or backup data could be exposed or potentially altered if the handler permits such operations.
- Sensitive device information could be disclosed, potentially supporting further attacks.
General mitigation guidance
Defensive patterns for path-handling features include:
- Resolve candidate paths to canonical form and verify they remain within an explicitly allowed directory.
- Prefer fixed identifiers or server-controlled mappings over accepting arbitrary paths from requests.
- Apply strict allowlists and reject traversal sequences or unexpected path formats.
- Restrict the backup process's filesystem permissions to only the files and directories it needs.
- Limit access to administrative endpoints through appropriate network and authentication controls.
How teams detect issues like this
- Review code that uses request parameters to construct, select, or open filesystem paths.
- Use static analysis to flag path concatenation and file operations involving externally controlled values.
- Inspect request and device logs for unusual backup endpoint activity or path-like values in the
optionargument. - Enforce code-review and CI policies requiring canonical path checks and directory-boundary validation.

