T09 · Insecure Skill Coding Practices
- Location
src/client.ts:35- Finding
Unvalidated API Destination Can Disclose Azure Bearer Tokens and CRM Data
- Content
View full analysis
{ const filter = `name eq '${escapeSingleQuotes(name)}'`; const resp = await fetch( `${this.baseUrl}/opportunities?$select=opportunityid&$filter=${encodeURIComponent(filter)}&$top=1`, { headers: this.headers }, ); ``` The same bearer-token-bearing headers and caller-derived base URL are used by the remaining request methods at lines 84–105, 120–157, 173–208, 223–256, and 275–280. ### Technical Analysis `instanceUrl` is used to construct the request destination without parsing or validating it. The implementation does not: - Require HTTPS. - Restrict the hostname to an approved Dynamics 365 tenant. - Reject localhost, private, loopback, or link-local destinations. - Reject embedded URL credentials, unexpected ports, query strings, or fragments. - Verify that the destination corresponds to the audience and tenant of the supplied access token. At the same time, the client places th ...[truncated 2838 chars]- Remediation
View remediation
