Summary
A path traversal flaw in DrayTek Vigor2960 affects the app_guest_export function in /cgi-bin/mainfunction.cgi, where the filename argument can be manipulated to reference paths outside the intended location. If the endpoint is remotely reachable, a crafted request may enable unauthorized file access; the exact impact depends on the files and operations available to the function.
Affected context
The issue occurs in the guest export functionality of the Vigor2960 web interface. It may be present when the CGI handler uses the supplied filename to construct or select a file path without reliably restricting access to the intended directory. Remote reachability of the endpoint affects exposure.
Exploit preconditions
- Attack surface: The
/cgi-bin/mainfunction.cgiendpoint hostingapp_guest_exportmust be reachable. - Required access: The description does not specify whether authentication is required; access requirements depend on the device's configuration and endpoint controls.
- Trigger point: Processing of the
filenameargument by the guest export function. - Why exploitation is possible: Path components in the supplied filename may be used without sufficient path validation or containment checks.
Why this happens
The handler appears to insufficiently constrain a user-influenced filename before using it in a file operation. If path components are accepted without canonicalization and a check that the resolved path remains within an intended directory, a request can escape that directory. This is a path traversal weakness, mapped to CWE-22: Improper Limitation of a Pathname to a Restricted Directory.
Potential impact
- May expose files outside the intended export location.
- Could disclose sensitive device or user data, depending on accessible files.
- May undermine confidentiality or integrity if the affected operation permits more than reading files.
- Could provide a foothold for further attacks if exposed data or device behavior enables them.
General mitigation guidance
Common defensive patterns include:
- Accepting a constrained file identifier or allowlisted name rather than an arbitrary path.
- Resolving paths to canonical form and verifying that they remain within the designated directory.
- Rejecting unexpected path separators and traversal components as a supplementary check, not as the sole boundary.
- Running file-handling processes with only the permissions they need and limiting access to sensitive locations.
- Keeping the management interface restricted to trusted networks and minimizing unnecessary remote exposure.
How teams detect issues like this
Review file-handling code for user-controlled values passed to path construction, file-opening, or export routines. Static analysis and code review can look for missing canonicalization, allowlists, and directory-containment checks. At the system level, monitor requests to the export endpoint for unusual filenames and apply policies that restrict access to management interfaces and sensitive filesystem paths.

