Summary
A path traversal vulnerability in the DrayTek Vigor2960 web interface allows remote manipulation of the multipart argument processed by the swmconfigupload component. Where the affected endpoint is reachable and input is insufficiently restricted, an attacker may access or manipulate files outside the intended directory.
A path traversal vulnerability in the DrayTek Vigor2960 web interface allows remote manipulation of the multipart argument processed by the swmconfigupload component. Where the affected endpoint is reachable and input is insufficiently restricted, an attacker may access or manipulate files outside the intended directory.
Affected context
The issue occurs in the cgiEscape function within /cgi-bin/mainfunction.cgi, specifically in the swmconfigupload component of affected Vigor2960 firmware. Risk depends on the web interface being reachable by an attacker and on the process having access to files beyond the intended upload or configuration directory. The product is also described as end-of-support, which can limit long-term remediation and review.
The issue occurs in the cgiEscape function within /cgi-bin/mainfunction.cgi, specifically in the swmconfigupload component of affected Vigor2960 firmware. Risk depends on the web interface being reachable by an attacker and on the process having access to files beyond the intended upload or configuration directory. The product is also described as end-of-support, which can limit long-term remediation and review.
Exploit preconditions
- Attack surface: Remotely reachable web interface endpoint
- Required access: Access sufficient to submit requests to the affected
swmconfiguploadfunctionality; authentication requirements may depend on deployment configuration - Trigger point: Processing of the
multipartargument bycgiEscape - Why exploitation is possible: Path input is not adequately constrained to the intended directory before file-related processing occurs
- Attack surface: Remotely reachable web interface endpoint
- Required access: Access sufficient to submit requests to the affected
swmconfiguploadfunctionality; authentication requirements may depend on deployment configuration - Trigger point: Processing of the
multipartargument bycgiEscape - Why exploitation is possible: Path input is not adequately constrained to the intended directory before file-related processing occurs
Why this happens
The underlying flaw is improper restriction and canonicalization of user-controlled path data. When a request parameter is used in file-handling logic without reliably rejecting traversal sequences and resolving the final path within an approved directory, an attacker may influence which filesystem location is accessed. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal.
The underlying flaw is improper restriction and canonicalization of user-controlled path data. When a request parameter is used in file-handling logic without reliably rejecting traversal sequences and resolving the final path within an approved directory, an attacker may influence which filesystem location is accessed. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal.
Potential impact
- An attacker may read files accessible to the web-service account
- An attacker could manipulate or overwrite files if the process has write permission
- Sensitive configuration data or credentials may be exposed
- Device integrity or availability could be affected
- The device may be used as a foothold for further attacks, depending on network placement
- An attacker may read files accessible to the web-service account
- An attacker could manipulate or overwrite files if the process has write permission
- Sensitive configuration data or credentials may be exposed
- Device integrity or availability could be affected
- The device may be used as a foothold for further attacks, depending on network placement
General mitigation guidance
Mitigation generally focuses on enforcing a strict filesystem trust boundary and reducing the privileges of the affected service.
Common defensive patterns include:
- Accepting only generated filenames or allowlisted relative names rather than arbitrary paths
- Canonicalizing paths and verifying that the resolved result remains beneath an approved directory
- Rejecting traversal markers, absolute paths, alternate path representations, and encoded equivalents
- Separating uploaded content from executable, configuration, and system directories
- Running web-facing services with minimal filesystem permissions
- Restricting administrative interfaces through network segmentation and access controls
- Monitoring the affected device lifecycle and using a maintained platform where practical
Mitigation generally focuses on enforcing a strict filesystem trust boundary and reducing the privileges of the affected service.
Common defensive patterns include:
- Accepting only generated filenames or allowlisted relative names rather than arbitrary paths
- Canonicalizing paths and verifying that the resolved result remains beneath an approved directory
- Rejecting traversal markers, absolute paths, alternate path representations, and encoded equivalents
- Separating uploaded content from executable, configuration, and system directories
- Running web-facing services with minimal filesystem permissions
- Restricting administrative interfaces through network segmentation and access controls
- Monitoring the affected device lifecycle and using a maintained platform where practical
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis rules identifying user-controlled values passed into file APIs or path construction
- Code review checks for missing canonicalization and directory-boundary validation
- Tests using encoded, alternate, absolute, and traversal-style path representations
- Web-application policies that alert on unusual
multipartvalues and requests targeting administrative upload functions - File-integrity monitoring for unexpected changes in web, configuration, or system locations
- Automated security review tools that flag path construction from request parameters
Organizations can look for this class of issue through:
- Static analysis rules identifying user-controlled values passed into file APIs or path construction
- Code review checks for missing canonicalization and directory-boundary validation
- Tests using encoded, alternate, absolute, and traversal-style path representations
- Web-application policies that alert on unusual
multipartvalues and requests targeting administrative upload functions - File-integrity monitoring for unexpected changes in web, configuration, or system locations
- Automated security review tools that flag path construction from request parameters

