How to fix: OAuth authorization request uses a cleartext redirect_uri
The scanned URL is an OAuth or OpenID Connect authorization request with a cleartext redirect_uri. The callback is a plain http URL on a host that is not loopback.
Why it matters
The authorization response, carrying either the authorization code or, in an implicit flow, the token itself, is delivered to that cleartext URL. Anyone on the network path reads it, and with the code in hand can complete the exchange before the real client does unless PKCE is enforced.
RFC 9700 requires redirect URIs to use https, with one exception: loopback addresses for native applications, which RFC 8252 section 7.3 explicitly permits over http. This check honours that exception and does not fire on localhost, 127.0.0.1 or ::1. Everything else is a real downgrade, whether the redirect target is first-party or not.
How to fix it
- 1Change the client's registered redirect URI to https.
- 2Configure the authorization server to reject any non-loopback http redirect_uri at registration time, not only at request time.
- 3Treat any code or token already delivered over http as disclosed and revoke the associated grants.
Code examples
Correct authorization request
GET /authorize
?response_type=code
&client_id=web-app
&redirect_uri=https%3A%2F%2Fapp.example.com%2Fcallback
&code_challenge_method=S256
&code_challenge=<challenge>
&state=<random>Server: reject cleartext redirect URIs
function isAllowedRedirect(uri) {
const u = new URL(uri);
if (u.protocol === 'https:') return true;
// RFC 8252 7.3: loopback over http is permitted for native apps
return u.protocol === 'http:' &&
['localhost', '127.0.0.1', '::1'].includes(u.hostname);
}References
Detected automatically by VulnRadar. The check id is api-oauth-authorize-redirect-uri-insecure, stable across every scan so you can filter or diff on it.
More api checks
- LowTRACE method referenced in API response body
- InfoREST endpoint allows DELETE
- LowGraphQL introspection field suggestions
- MediumGraphQL endpoint has no rate-limit headers
- LowOpenAPI server URL leaks internal host
- LowCORS preflight result not cached
- HighBearer token in URL query string
- MediumJSONP callback parameter accepted
Questions
- How severe is OAuth authorization request uses a cleartext redirect_uri?
- VulnRadar rates this medium severity in the api category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
- Does VulnRadar check for this automatically?
- Yes. It runs as part of every scan under the check id api-oauth-authorize-redirect-uri-insecure, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does OAuth authorization request uses a cleartext redirect_uri map to?
- It maps to CWE-319. In the OWASP Top 10 it falls under A02:2021.
Missing a check?
The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.