Summary
A path traversal vulnerability in the DrayTek Vigor2960 allows remotely supplied input to influence file path handling in the setSWMProfile function.
Under conditions where the vulnerable CGI endpoint is reachable and insufficiently protected, an attacker may access or manipulate files outside the intended directory scope.
A path traversal vulnerability in the DrayTek Vigor2960 allows remotely supplied input to influence file path handling in the setSWMProfile function.
Under conditions where the vulnerable CGI endpoint is reachable and insufficiently protected, an attacker may access or manipulate files outside the intended directory scope.
Affected context
The vulnerability occurs in the setSWMProfile function within /cgi-bin/mainfunction.cgi on affected Vigor2960 firmware.
It is associated with the handling of the setSWMProfile argument and may be reachable remotely through the device's web interface. The described issue affects a legacy product that is no longer generally supported, so deployment exposure and available maintenance controls may vary.
The vulnerability occurs in the setSWMProfile function within /cgi-bin/mainfunction.cgi on affected Vigor2960 firmware.
It is associated with the handling of the setSWMProfile argument and may be reachable remotely through the device's web interface. The described issue affects a legacy product that is no longer generally supported, so deployment exposure and available maintenance controls may vary.
Exploit preconditions
- Attack surface: The Vigor2960 web CGI interface, specifically the
mainfunction.cgihandler - Required access: Network reachability to the affected device; additional authentication requirements depend on deployment configuration
- Trigger point: Processing of the
setSWMProfileargument by thesetSWMProfilefunction - Why exploitation is possible: Input influencing a filesystem path is not sufficiently constrained to the intended directory, allowing traversal beyond the expected path boundary
- Attack surface: The Vigor2960 web CGI interface, specifically the
mainfunction.cgihandler - Required access: Network reachability to the affected device; additional authentication requirements depend on deployment configuration
- Trigger point: Processing of the
setSWMProfileargument by thesetSWMProfilefunction - Why exploitation is possible: Input influencing a filesystem path is not sufficiently constrained to the intended directory, allowing traversal beyond the expected path boundary
Why this happens
The underlying bug is improper restriction of user-controlled path components. When an application constructs or resolves filesystem paths from request data without canonicalization and boundary enforcement, traversal sequences may cause the resulting path to escape its intended directory.
This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
The underlying bug is improper restriction of user-controlled path components. When an application constructs or resolves filesystem paths from request data without canonicalization and boundary enforcement, traversal sequences may cause the resulting path to escape its intended directory.
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 configuration directory
- An attacker could alter or replace files if the affected process has write permissions
- Device configuration or credentials may be exposed
- Successful exploitation could support persistence, service disruption, or follow-on compromise
- An attacker may read files outside the intended configuration directory
- An attacker could alter or replace files if the affected process has write permissions
- Device configuration or credentials may be exposed
- Successful exploitation could support persistence, service disruption, or follow-on compromise
General mitigation guidance
Mitigation generally focuses on eliminating direct trust in request-controlled filesystem paths and reducing the privileges available to the web process.
Common defensive patterns include:
- Resolve paths canonically and verify that they remain within an approved base directory
- Prefer fixed identifiers mapped to server-side filenames over user-supplied path values
- Reject traversal indicators and unexpected path separators as defense-in-depth, not as the sole control
- Apply strict allowlists and schema validation to profile-related parameters
- Run web-facing services with the minimum filesystem permissions required
- Restrict administrative interfaces to trusted management networks and use compensating controls for unsupported devices
- Maintain a supported firmware lifecycle where feasible and isolate legacy equipment when continued operation is necessary
Mitigation generally focuses on eliminating direct trust in request-controlled filesystem paths and reducing the privileges available to the web process.
Common defensive patterns include:
- Resolve paths canonically and verify that they remain within an approved base directory
- Prefer fixed identifiers mapped to server-side filenames over user-supplied path values
- Reject traversal indicators and unexpected path separators as defense-in-depth, not as the sole control
- Apply strict allowlists and schema validation to profile-related parameters
- Run web-facing services with the minimum filesystem permissions required
- Restrict administrative interfaces to trusted management networks and use compensating controls for unsupported devices
- Maintain a supported firmware lifecycle where feasible and isolate legacy equipment when continued operation is necessary
How teams detect issues like this
Organizations can look for path traversal risks through:
- Static analysis rules identifying filesystem APIs that consume HTTP parameters or CGI arguments
- Code review checks for missing canonicalization, base-directory validation, or filename allowlists
- Web application firewall policies monitoring traversal patterns and abnormal profile-management requests
- Device and network logs showing unusual requests to CGI endpoints or unexpected configuration-file access
- File integrity monitoring for changes to sensitive device files where such telemetry is available
Automated security scanning and code review tools may help identify similar path-handling patterns, but findings should be validated against the device's actual filesystem behavior.
Organizations can look for path traversal risks through:
- Static analysis rules identifying filesystem APIs that consume HTTP parameters or CGI arguments
- Code review checks for missing canonicalization, base-directory validation, or filename allowlists
- Web application firewall policies monitoring traversal patterns and abnormal profile-management requests
- Device and network logs showing unusual requests to CGI endpoints or unexpected configuration-file access
- File integrity monitoring for changes to sensitive device files where such telemetry is available
Automated security scanning and code review tools may help identify similar path-handling patterns, but findings should be validated against the device's actual filesystem behavior.

