loopbackio / loopbackio/loopback-next

High severity CVEs in the rest component

Open
#11,500 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
5.1k
Forks
1.1k
Avg merge
2d 21h
Merged PRs (30d)
27

Description

### Describe the bug

There are several CVEs posted against the version of undici used by the version of openapi that this project is using. As of the past few days some high severity items came in, so this probably should be looked at as its causing audit failures.

CVEs:
Undici has an unbounded decompression chain in HTTP responses on Node.js Fetch API via Content-Encoding leads to resource exhaustion - https://github.com/advisories/GHSA-g9mf-h72j-4rw9
Undici has an HTTP Request/Response Smuggling issue - https://github.com/advisories/GHSA-2mjp-6q6p-2qxm
Undici has Unbounded Memory Consumption in WebSocket permessage-deflate Decompression - https://github.com/advisories/GHSA-vrm6-8vpv-qv8q
Undici has Unhandled Exception in WebSocket Client Due to Invalid server_max_window_bits Validation - https://github.com/advisories/GHSA-v9p9-hfj2-hcw8
Undici has CRLF Injection in undici via `upgrade` option - https://github.com/advisories/GHSA-4992-7rv2-5pvq

I am not sure what a good fix is here because the @openapi-contrib/openapi-schema-to-json-schema package that rest is relying on hasn't been updated in 3 years, so it is probably no longer maintained.

### Logs

```shell
undici <=6.23.0
Severity: high
Undici has an unbounded decompression chain in HTTP responses on Node.js Fetch API via Content-Encoding leads to resource exhaustion - https://github.com/advisories/GHSA-g9mf-h72j-4rw9
Undici has an HTTP Request/Response Smuggling issue - https://github.com/advisories/GHSA-2mjp-6q6p-2qxm
Undici has Unbounded Memory Consumption in WebSocket permessage-deflate Decompression - https://github.com/advisories/GHSA-vrm6-8vpv-qv8q
Undici has Unhandled Exception in WebSocket Client Due to Invalid server_max_window_bits Validation - https://github.com/advisories/GHSA-v9p9-hfj2-hcw8
Undici has CRLF Injection in undici via `upgrade` option - https://github.com/advisories/GHSA-4992-7rv2-5pvq
fix available via `npm audit fix --force`
Will install @loopback/rest@7.0.1, which is a breaking change
node_modules/undici
openapi-typescript 5.1.1 - 6.7.6
Depends on vulnerable versions of undici
node_modules/openapi-typescript
@openapi-contrib/openapi-schema-to-json-schema >=4.0.1
Depends on vulnerable versions of openapi-typescript
node_modules/@openapi-contrib/openapi-schema-to-json-schema
@loopback/rest >=13.1.1
Depends on vulnerable versions of @openapi-contrib/openapi-schema-to-json-schema
node_modules/@loopback/rest
```

### Additional information

_No response_

### Reproduction

n/a

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names @loopback/rest, @openapi-contrib/openapi-schema-to-json-schema, openapi-typescript, and undici; start by tracing that npm dependency chain and running the reported audit. Done means the listed high-severity advisories are addressed without relying on the stated breaking upgrade to @loopback/rest@7.0.1.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, openapi, typescript
Domain
api, backend, security
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.