T09 · Insecure Skill Coding Practices
- Location
references/09_微信接口.md:295- Finding
Hard-Coded WeChat Application Secrets in Executable Examples
- Content
View full analysis
3600 Then Dim hc As New HttpClient(CExp(url, AppId, AppSecret)) Dim ret As String = hc.GetData() End If ``` The same credential values are reused in OAuth and access-token examples. Another credential-shaped secret appears at line 6039: ```vb CExp(ul, "wx8acdb7df5beb68fd", "dec0df8a469518df30e9bdef0758c678", e.GetValues("code")) ``` ### Technical Analysis The documentation embeds realistic WeChat AppId and AppSecret values directly in executable examples. The AppSecret is then interpolated into a URL query parameter when requesting an access token. Hard-coded credentials can be extracted by anyone who receives the Skill package. Secrets placed in URLs may additionally be captured in application logs, HTTP client diagnostics, reverse-proxy logs, monitoring systems, browser history, or exception reports. Although TLS protects the request in transit, it does not prevent local or intermediary systems from recording the complete URL. The documentation states that users should replace the values, but that warning does not protect any displayed credential that remains active and encourages users to reproduce the insecure secret-management pattern. ### Attack Path 1. An attacker obtains the publicly distributed Skill reference file. 2. The attacker extracts the embedded AppId and AppSecret values. 3. If a displayed credential re ...[truncated 1057 chars]- Remediation
View remediation
