Skip to content

fix: protect link recursion from max call stack - #3113

Merged
Marsup merged 1 commit into
masterfrom
fix/link-max-call-stack
May 4, 2026
Merged

fix: protect link recursion from max call stack#3113
Marsup merged 1 commit into
masterfrom
fix/link-max-call-stack

Conversation

@Marsup

@Marsup Marsup commented May 4, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@pedrofurtado-cw

Copy link
Copy Markdown

@Marsup This fix will be provided for 17.x?

@harjot339

Copy link
Copy Markdown

@Marsup I'm still seeing GHSA-q7cg-457f-vx79 reported by yarn audit with joi@17.13.4 installed.

Since the fix was backported to 17.13.4, is the advisory metadata still pending an update? This currently appears to be a false positive.

@Marsup

Marsup commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator Author

I just updated it, I'm not sure how long it takes to propagate.

@tats-u

tats-u commented Jun 12, 2026

Copy link
Copy Markdown

We appreciate your quick response again.

chrispymm pushed a commit to ministryofjustice/moj-frontend that referenced this pull request Jun 29, 2026
This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [joi](https://redirect.github.com/hapijs/joi) | [`17.13.3` →
`17.13.4`](https://renovatebot.com/diffs/npm/joi/17.13.3/17.13.4) |
![age](https://developer.mend.io/api/mc/badges/age/npm/joi/17.13.4?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/joi/17.13.3/17.13.4?slim=true)
|

---

### joi has an uncaught RangeError on deeply nested input through
recursive `link()` schemas
[CVE-2026-48038](https://nvd.nist.gov/vuln/detail/CVE-2026-48038) /
[GHSA-q7cg-457f-vx79](https://redirect.github.com/advisories/GHSA-q7cg-457f-vx79)

<details>
<summary>More information</summary>

#### Details
##### Impact
Denial of service via untrapped exception in services validating
user-supplied JSON / object input with recursive link schemas.

The blast radius depends on how the application invokes joi:
- Highest impact: `validate()` called without `try/catch` in a request
handler would cause an unhandled exception, potentially crashing the
process.
- Lower impact: `validateAsync()` or `validate()` inside a `try/catch`,
the validation fails, but the error type is `RangeError` rather than a
structured `ValidationError`, complicating error handling.

##### Patches
Upgrade to version >= 18.2.1.

##### Workarounds
Try/catch the validation to avoid uncaught exceptions.

##### References
- Pull request: hapijs/joi#3113

#### Severity
- CVSS Score: 5.3 / 10 (Medium)
- Vector String: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`

#### References
-
[https://github.com/hapijs/joi/security/advisories/GHSA-q7cg-457f-vx79](https://redirect.github.com/hapijs/joi/security/advisories/GHSA-q7cg-457f-vx79)
-
[https://github.com/hapijs/joi/pull/3113](https://redirect.github.com/hapijs/joi/pull/3113)
-
[https://github.com/hapijs/joi/commit/2392713d3e9dd91ba752ac0c96e0eaf3d24b9a11](https://redirect.github.com/hapijs/joi/commit/2392713d3e9dd91ba752ac0c96e0eaf3d24b9a11)
-
[https://github.com/advisories/GHSA-q7cg-457f-vx79](https://redirect.github.com/advisories/GHSA-q7cg-457f-vx79)

This data is provided by the [GitHub Advisory
Database](https://redirect.github.com/advisories/GHSA-q7cg-457f-vx79)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### Release Notes

<details>
<summary>hapijs/joi (joi)</summary>

###
[`v17.13.4`](https://redirect.github.com/hapijs/joi/compare/v17.13.3...3d3ab76fad0170e97bdd72e96be7ce32330cde8f)

[Compare
Source](https://redirect.github.com/hapijs/joi/compare/v17.13.3...v17.13.4)

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/ministryofjustice/moj-frontend).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMTkuMCIsInVwZGF0ZWRJblZlciI6IjQzLjIxOS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJwcmV2aWV3OiByZXF1ZXN0IiwicmVub3ZhdGU6IGRlcGVuZGVuY2llcyDwn5eD77iPIl19-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Bug or defect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants