T09 · Insecure Skill Coding Practices
- Location
scripts/run_web_extract.mjs:161- Finding
Bearer API Credential Can Be Redirected to an Arbitrary Endpoint
- Content
View full analysis
Vulnerability Details
File Location:
scripts/run_web_extract.mjs:161, 177-190
Vulnerability Type: Unrestricted credential-bearing endpoint override
Risk Level: HighVulnerable Code:
javascript const apiBase = (process.env.FELO_API_BASE?.trim() || DEFAULT_API_BASE).replace(/\/$/, ''); const shortUrl = args.url.length > 45 ? args.url.slice(0, 42) + '...' : args.url; const spinnerId = startSpinner(`Fetching ${shortUrl}`); try { const body = { url: args.url, output_format: args.format, crawl_mode: args.crawlMode, with_readability: args.readability, timeout: args.timeoutMs, }; if (args.targetSelector) body.target_selector = args.targetSelector; if (args.waitForSelector) body.wait_for_selector = args.waitForSelector; const payload = await fetchJson( `${apiBase}/v2/web/extract`, { method: 'POST', headers: { Accept: 'application/json', Authorization: `Bearer ${apiKey}`, 'Content-Type': 'application/json', },The corresponding endpoint override is documented in
SKILL.md:130:markdown - **Base URL**: `https://openapi.felo.ai`. Override with `FELO_API_BASE` env if needed.Technical Analysis
The script reads
FELO_API_BASEfrom the process environment without validating its URL scheme, hostname, port, or trust relationship. It then sends the value ofFELO_API_KEYas a bearer credential to the resulting endpoint.The default network request to Felo is necessary for the declared hosted webpage-extraction functionality. The unrestricted endpoint override is not necessary for the standard workflow and exceeds the minimum trust boundary required by that functionality. It permits credential-bearing requests to arbitrary HTTPS hosts and even plaintext HTTP endpoints.
Although exploitation requires influence over the process environment or launch configuration, such influence ma ...[truncated 1493 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove
FELO_API_BASEsupport if custom service endpoints are not an essential requirement. - If an override is required, parse it with the standard
URLAPI and reject malformed values. - Require the
https:scheme and reject plaintext HTTP, embedded credentials, fragments, and unexpected ports. - Restrict credential-bearing requests to an explicit hostname allowlist, preferably only
openapi.felo.ai. - Do not forward the production
FELO_API_KEYto custom endpoints. Require a distinct environment variable for non-Felo services. - Make custom endpoint use an explicit command-line opt-in and display the destination hostname before sending credentials.
- Document that requested URLs and extraction parameters are sent to the remote provider.
- Use narrowly scoped, revocable API keys and rotate any key that may have been sent to an untrusted endpoint.
- Remove
