All @feathersjs/authentication-oauth versions
@feathersjs/authentication-oauth @4.5.19
Maintainers
Keywords
Dependencies (9)
| Package | Constraint | Registry Status |
|---|---|---|
| debug | ^4.4.3 | auto_approved |
| grant | ^4.7.0 | pending |
| lodash | ^4.17.23 | auto_approved |
| grant-profile | ^0.0.11 | Not imported |
| express-session | ^1.19.0 | auto_approved |
| @feathersjs/errors | ^4.5.19 | auto_approved |
| @feathersjs/express | ^4.5.19 | auto_approved |
| @feathersjs/feathers | ^4.5.19 | pending |
| @feathersjs/authentication | ^4.5.19 | auto_approved |
Dev Dependencies (11)
| Package | Constraint | Registry Status |
|---|---|---|
| shx | ^0.4.0 | auto_approved |
| axios | ^0.30.2 | auto_approved |
| mocha | ^9.2.2 | auto_approved |
| ts-node | ^10.9.2 | pending |
| typescript | ^4.9.5 | auto_approved |
| @types/node | ^17.0.45 | auto_approved |
| @types/debug | ^4.1.12 | auto_approved |
| @types/mocha | ^9.1.1 | auto_approved |
| @types/lodash | ^4.17.23 | auto_approved |
| @types/express | ^4.17.25 | auto_approved |
| @types/express-session | ^1.18.2 | auto_approved |
Transitive Dependency Tree
Risk Dispositions (3 applicable to this version, 0 other)
Accepted rules are downgraded to INFO on future analyses; rejected rules escalate to CRITICAL.
| Rule | Source | Disposition | Author | Reason | |
|---|---|---|---|---|---|
osv:GHSA-ppf9-4ffw-hh4p |
osv | reject | AI | AI (osv): Open redirect enabling account takeover; affects all versions < 5.0.40. Verdict generalizes to every version in the affected range. | |
osv:GHSA-mp4x-c34x-wv3x |
osv | reject | AI | AI (osv): Origin validation bypass enabling token exfiltration; affects all versions < 5.0.40. Verdict generalizes to every version in the affected range. | |
osv:GHSA-9m9c-vpv5-9g85 |
osv | reject | AI | AI (osv): Sensitive headers exposed via unencrypted session cookie; affects all versions < 5.0.40. Verdict generalizes to every version in the affected range. |
SAST Findings (4)
All HTTP request headers are stored in the session cookie, which is signed but not encrypted, exposing internal proxy/gateway headers to clients. The OAuth service stores the complete headers object in the session: ```javascript // https://github.com/feathersjs/feathers/blob/dove/packages/authentication-oauth/src/service.ts#L173 session.headers = headers; ``` The session is persisted using `cookie-session`, which base64-encodes the data. While the cookie is signed to prevent tampering, the contents are readable by anyone by simply decoding the base64 value. Under specific deployment configurations (e.g., behind reverse proxies or API gateways), this can lead to exposure of sensitive internal infrastructure details such as API keys, service tokens, and internal IP addresses. **Credits**: Abdelwahed Madani Yousfi (@vvxhid) / Edoardo Geraci (@b0-n0-b0) / Thomas Rinsma (@ThomasRinsma) From Codean Labs.
The origin validation uses `startsWith()` for comparison, allowing attackers to bypass the check by registering a domain that shares a common prefix with an allowed origin. The `getAllowedOrigin()` function checks if the Referer header starts with any allowed origin: ```javascript // https://github.com/feathersjs/feathers/blob/dove/packages/authentication-oauth/src/strategy.ts#L75 const allowedOrigin = origins.find((current) => referer.toLowerCase().startsWith(current.toLowerCase())); ``` This comparison is insufficient as it only validates the prefix. This is exploitable when the `origins` array is configured and an attacker registers a domain starting with an allowed origin string (e.g., `https://target.com.attacker.com` bypasses `https://target.com`). On its own, tokens are still redirected to a configured origin. However, in specific scenarios an attacker can initiate the OAuth flow from an unauthorized origin and exfiltrate tokens, achieving full account takeover. **Credits**: Abdelwahed Madani Yousfi (@vvxhid) / Edoardo Geraci (@b0-n0-b0) / Thomas Rinsma (@ThomasRinsma) From Codean Labs.
### Description The `redirect` query parameter is appended to the base origin without validation, allowing attackers to steal access tokens via URL authority injection. This leads to full account takeover, as the attacker obtains the victim's access token and can impersonate them. The application constructs the final redirect URL by concatenating the base origin with the user-supplied `redirect` parameter: ```javascript // https://github.com/feathersjs/feathers/blob/dove/packages/authentication-oauth/src/service.ts#L158C3-L176C4 const { redirect } = query; ... session.redirect = redirect; // https://github.com/feathersjs/feathers/blob/dove/packages/authentication-oauth/src/strategy.ts#L98 const redirectUrl = `${redirect}${queryRedirect}`; ``` Where: - `redirect` = base origin from config (e.g., `https://target.com`) - `queryRedirect` = user input from `?redirect=` parameter This is exploitable when the `origins` array is configured and origin values do not end with `/`. An attacker can supply `@attacker.com` as the redirect value results in `https://[email protected]#access_token=...`, where the browser interprets `attacker.com` as the host, leading to full account takeover. **Credits**: Abdelwahed Madani Yousfi (@vvxhid) / Edoardo Geraci (@b0-n0-b0) / Thomas Rinsma (@ThomasRinsma) From Codean Labs.
[Accepted risk] Package was published without Sigstore provenance. Only ~12% of npm packages have provenance, so this is common but not ideal.
Review Summary
Risk score: 85. Findings: 3 high (+75), 1 medium (+10), 1 info (+0).
Commit: f3bf30f6c7f7 Browse source
Published to npm: