Summary
A path traversal vulnerability in DrayTek Vigor2960's Apmupload component allows a remotely supplied action argument to influence file-path handling in mainfunction.cgi.
Where the affected endpoint is reachable and insufficiently protected, an attacker may access files outside the intended directory, depending on the process permissions and filesystem controls.
A path traversal vulnerability in DrayTek Vigor2960's Apmupload component allows a remotely supplied action argument to influence file-path handling in mainfunction.cgi.
Where the affected endpoint is reachable and insufficiently protected, an attacker may access files outside the intended directory, depending on the process permissions and filesystem controls.
Affected context
The issue affects deployments of DrayTek Vigor2960 firmware that expose the Apmupload functionality through /cgi-bin/mainfunction.cgi. It becomes risky when the action parameter is processed as part of a filesystem path without reliably constraining the resulting location to an approved directory. Exploitability and impact may depend on endpoint exposure, authentication controls, and the privileges of the web service.
The issue affects deployments of DrayTek Vigor2960 firmware that expose the Apmupload functionality through /cgi-bin/mainfunction.cgi. It becomes risky when the action parameter is processed as part of a filesystem path without reliably constraining the resulting location to an approved directory. Exploitability and impact may depend on endpoint exposure, authentication controls, and the privileges of the web service.
Exploit preconditions
- Attack surface: A remotely reachable HTTP or HTTPS management interface exposing
mainfunction.cgi - Required access: The description does not establish whether authentication is required; access to the vulnerable endpoint is the key prerequisite
- Trigger point: Processing the
actionargument by the Apmupload component - Why exploitation is possible: User-controlled path components may escape the intended directory when canonicalization and boundary validation are insufficient
- Attack surface: A remotely reachable HTTP or HTTPS management interface exposing
mainfunction.cgi - Required access: The description does not establish whether authentication is required; access to the vulnerable endpoint is the key prerequisite
- Trigger point: Processing the
actionargument by the Apmupload component - Why exploitation is possible: User-controlled path components may escape the intended directory when canonicalization and boundary validation are insufficient
Why this happens
The underlying bug is improper limitation of a user-controlled filesystem path. If path input is concatenated, decoded, or normalized without verifying that the final canonical path remains within an approved base directory, traversal sequences can redirect file operations to unintended locations. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
The underlying bug is improper limitation of a user-controlled filesystem path. If path input is concatenated, decoded, or normalized without verifying that the final canonical path remains within an approved base directory, traversal sequences can redirect file operations to unintended locations. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Potential impact
- An attacker may read files outside the intended application directory
- Sensitive configuration data or credentials could be disclosed
- Files may be modified or deleted if the vulnerable operation permits write access
- The device could experience service disruption or follow-on compromise through exposed secrets
- An attacker may read files outside the intended application directory
- Sensitive configuration data or credentials could be disclosed
- Files may be modified or deleted if the vulnerable operation permits write access
- The device could experience service disruption or follow-on compromise through exposed secrets
General mitigation guidance
Mitigation generally focuses on removing trust in client-controlled path values and enforcing filesystem boundaries.
Common defensive patterns include:
- Prefer fixed server-side resource identifiers over user-supplied paths
- Resolve and canonicalize paths before use, then verify they remain under an approved directory
- Reject traversal encodings, absolute paths, symbolic-link escapes, and unexpected separators
- Apply allowlists for permitted actions and filenames rather than attempting to block known traversal strings
- Run management services with the least filesystem privileges necessary
- Restrict management interfaces through network policy, administrative access controls, and secure deployment defaults
- Retire or isolate unsupported devices where security maintenance and validation are limited
Mitigation generally focuses on removing trust in client-controlled path values and enforcing filesystem boundaries.
Common defensive patterns include:
- Prefer fixed server-side resource identifiers over user-supplied paths
- Resolve and canonicalize paths before use, then verify they remain under an approved directory
- Reject traversal encodings, absolute paths, symbolic-link escapes, and unexpected separators
- Apply allowlists for permitted actions and filenames rather than attempting to block known traversal strings
- Run management services with the least filesystem privileges necessary
- Restrict management interfaces through network policy, administrative access controls, and secure deployment defaults
- Retire or isolate unsupported devices where security maintenance and validation are limited
How teams detect issues like this
Organizations can look for path traversal risks through:
- Static analysis rules identifying user input used in filesystem APIs
- Code review checks for path concatenation without canonicalization and boundary validation
- Tests covering encoded traversal, alternate separators, absolute paths, and symlink behavior
- Web and device logs showing unusual
actionvalues or requests targeting filesystem-like locations - Policy enforcement requiring allowlisted resource mapping for administrative endpoints
- Automated security review tools that flag CWE-22 patterns during development
Organizations can look for path traversal risks through:
- Static analysis rules identifying user input used in filesystem APIs
- Code review checks for path concatenation without canonicalization and boundary validation
- Tests covering encoded traversal, alternate separators, absolute paths, and symlink behavior
- Web and device logs showing unusual
actionvalues or requests targeting filesystem-like locations - Policy enforcement requiring allowlisted resource mapping for administrative endpoints
- Automated security review tools that flag CWE-22 patterns during development

