Summary
An incorrect access-control check in the TOTOLINK T6 getWanInfo function exposes WAN information through a CGI endpoint. An unauthenticated attacker who sends a specially crafted POST request may retrieve network configuration details without first proving access to the router.
Affected context
The issue occurs in TOTOLINK T6 firmware version 4.1.5cu.748_B20211015 when the /cgi-bin/cstecgi.cgi endpoint processes requests for the getWanInfo function. Risk is present where the endpoint is reachable by untrusted clients and the function does not consistently enforce authentication or authorization before returning WAN information.
Exploit preconditions
- Attack surface: The router's CGI interface at
/cgi-bin/cstecgi.cgi - Required access: Network reachability to the endpoint; valid authentication may not be required
- Trigger point: A crafted POST request invoking the
getWanInfofunction - Why exploitation is possible: The endpoint returns WAN information without applying an effective access-control check
Why this happens
The vulnerability results from an authorization failure in a management endpoint. The getWanInfo function appears to trust a request reaching the CGI handler without verifying whether the caller is permitted to access WAN details. This behavior maps to CWE-284: Improper Access Control, in which a protected resource or operation is exposed because authorization enforcement is missing, incomplete, or inconsistently applied.
Potential impact
- An attacker may obtain WAN configuration or status information
- Exposed network details could support further reconnaissance
- The disclosure could help an attacker identify external connectivity and routing characteristics
- Users may experience loss of confidentiality for router-management data
General mitigation guidance
Mitigation generally focuses on enforcing authorization consistently for every management operation and reducing the amount of information returned to untrusted callers.
Common defensive patterns include:
- Requiring authentication and explicit authorization before processing WAN-information requests
- Applying centralized access-control checks rather than endpoint-specific assumptions
- Returning only the minimum information necessary for the requesting role
- Treating all CGI parameters and request bodies as untrusted input
- Restricting management interfaces to trusted administrative networks where feasible
- Using least-privilege roles and secure-by-default administrative exposure
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis and code review checks for management handlers that return data before authorization
- Tests that invoke sensitive CGI actions without credentials and verify access is denied
- API inventories that identify endpoints exposing configuration or network information
- Monitoring for unauthenticated POST requests to router-management CGI paths
- Policy enforcement requiring centralized authentication and authorization on administrative APIs
- Automated security review tools that flag sensitive operations lacking consistent access checks

