T09 · Insecure Skill Coding Practices
- Location
SKILL.md:104- Finding
Personal Information Exposed Through Debug Logging
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 104-109
Vulnerability Type: Sensitive information exposure through application logs
Risk Level: MediumVulnerable Code
javascript wx.getUserProfile({ success: res => { console.log(res.userInfo); } });Technical Analysis
The example writes the complete
userInfoobject returned bywx.getUserProfileto the console. Depending on the platform and application configuration, console output may be accessible through development tools, remote debugging sessions, captured device logs, screenshots, or centralized logging services.Because this is presented as a reusable development template, developers may copy it into production code without removing the diagnostic statement. The exposure does not occur merely by loading the Skill; it requires the example to be incorporated into an application and executed after the user authorizes profile access.
Attack Path
- A developer copies the profile authorization example into a Mini Program.
- The application requests and receives authorized user profile information.
- The callback writes the returned profile object to application logs.
- Logs are retained by debugging, monitoring, or log aggregation infrastructure.
- A person with unauthorized or excessive access to those logs retrieves the exposed profile information.
Impact Assessment
An attacker cannot directly gain system privileges through this issue. The affected scope is limited to profile data processed by application instances containing the copied example. Potential impact includes unauthorized disclosure of personal information, privacy violations, and increased exposure through third-party logging infrastructure.
- Remediation
View remediation
Remediation Suggestions
- Remove logging of the complete
userInfoobject. - If diagnostics are necessary, log only non-sensitive status information, such as whether authorization succeeded.
- Redact or tokenize any identifiers before they enter logs.
- Disable verbose logging in production builds.
- Configure retention periods and access controls for development and centralized logs.
- Add an explicit warning to the template that authorized profile data must not be written to logs.
A safer example is:
javascript wx.getUserProfile({ success: () => { console.log('User profile authorization succeeded'); }, fail: () => { console.log('User profile authorization failed'); } });- Remove logging of the complete
