# GHSA-8wgc-jjvv-cv6v: Improper Authorization in loopback

> Attackers can create authentication tokens for any user if the AccessToken model is exposed, leading to unauthorized data access and privilege escalation.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 2 Sep 2020

## What is GHSA-8wgc-jjvv-cv6v?

GHSA-8wgc-jjvv-cv6v is a missing authorization vulnerability in loopback, published on 2 Sep 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Vulnerable versions of `loopback` may allow attackers to create Authentication Tokens on behalf of other users due to Improper Authorization. If the AccessToken model is publicly exposed, an attacker can create Authorization Tokens for any user as long as they know the target's `userId`. This will allow the attacker to access the user's data and their privileges.

## Recommendation

For loopback 2.x, upgrade to version 2.40.0 or later
For loopback 3.x, upgrade to version 3.22.0 or later

## Which versions are affected by GHSA-8wgc-jjvv-cv6v?

4 open source packages ship an affected version, including loopback.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `loopback` | npm | All versions | 2.40.0 |
| `loopback` | npm | All versions | 2.40.0 |
| `loopback` | npm | From 3.0.0 | 3.22.0 |
| `loopback` | npm | From 3.0.0 | 3.22.0 |

## How do I fix GHSA-8wgc-jjvv-cv6v?

Upgrade loopback to a fixed version for your release line: 2.40.0 or 3.22.0.

## Is GHSA-8wgc-jjvv-cv6v being exploited?

There is no known exploitation of GHSA-8wgc-jjvv-cv6v in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-8wgc-jjvv-cv6v and fix it if it is affected.

What it is: GHSA-8wgc-jjvv-cv6v is a missing authorization vulnerability in loopback, published on 2 Sep 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-8wgc-jjvv-cv6v in the wild and no public exploit code.

Affected packages and fixed versions:
- loopback (npm): affected all versions; fixed in 2.40.0
- loopback (npm): affected all versions; fixed in 2.40.0
- loopback (npm): affected from 3.0.0; fixed in 3.22.0
- loopback (npm): affected from 3.0.0; fixed in 3.22.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-8wgc-jjvv-cv6v/ (Markdown: https://insights.sbomify.com/GHSA-8wgc-jjvv-cv6v/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-8wgc-jjvv-cv6v

---
From sbomify Insights: https://insights.sbomify.com/GHSA-8wgc-jjvv-cv6v/
Summaries are generated and may contain mistakes; the official description above is the record.
