Vulnerabilities in pkg:npm/@adonisjs/lucid

PACKAGE
Advisory Identifier: GHSA-g5gc-h5hp-555f
Advisory Summary

CVE-2026-22814 is a HIGH mass assignment vulnerability (CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes) affecting @adonisjs/lucid libraries in the npm ecosystem. The issue involves mass assignment in adonisjs lucid allows overwriting internal orm state. Remediation is available by upgrading affected packages to version 21.8.2, 22.0.0-next.6.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@adonisjs/lucid

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@adonisjs/lucid. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-g5gc-h5hp-555f CVE-2026-22814 HIGH Mass Assignment in AdonisJS Lucid Allows Overwriting Internal ORM State

CVE-2026-22814 at a Glance

CVE Identifier CVE-2026-22814
GHSA Identifier GHSA-g5gc-h5hp-555f
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes
Affected Product @adonisjs/lucid
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-22814

To remediate this vulnerability, upgrade all affected @adonisjs/lucid dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@adonisjs/lucid fixed: 21.8.2
npm install @adonisjs/lucid@21.8.2
@adonisjs/lucid fixed: 22.0.0-next.6
npm install @adonisjs/lucid@22.0.0-next.6
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @adonisjs/lucid

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-22814, inspect your project dependencies using npm:

npm ls @adonisjs/lucid

Analyze the terminal output to locate any version of @adonisjs/lucid in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 21.8.2), your application is affected.

Note: The npm ls @adonisjs/lucid command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes, where the product receives input from an upstream component that specifies multiple attributes, properties, or fields that are to be initialized or updated in an object, but it does not properly control which attributes can be modified. In @adonisjs/lucid, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary **Description** A Mass Assignment (CWE-915) vulnerability in AdonisJS Lucid may allow a remote attacker who can influence data that is passed into Lucid model assignments to overwrite the internal ORM state. This may lead to logic bypasses and unauthorized record modification within a table or model. This affects @adonisjs/lucid through version 21.8.1 and 22.x pre-release versions prior to 22.0.0-next.6. This has been patched in @adonisjs/lucid versions 21.8.2 and 22.0.0-next.6. ### Details A vulnerability in the `BaseModelImpl` class of `@adonisjs/lucid` may allow an attacker to overwrite internal class properties (such as `$isPersisted`, `$attributes`, or `$isDeleted`) when passing plain objects to model assignment methods. The library relies on a `this.hasOwnProperty(key)` check to validate assignment targets. However, because internal ORM state properties are initialized as instance properties, they pass this check. Consequently, if an attacker can influence specific keys (like `$isPersisted`) into the payload passed to `merge()` or `$consumeAdapterResult()`, they can hijack the ORM's internal logic. The exposed internal properties include: - `$attributes`: The raw storage for model data. - `$isPersisted`: Controls whether `save()` performs an `INSERT` or an `UPDATE`. - `$original`: Stores the original state of the record used to calculate changes. - `$isDeleted`: Prevents operations on deleted models. This issue propagates to the entire write surface of the library, including: - Instance methods `fill` and `merge`. - Single record creation methods `create`, `createQuietly`, `firstOrNew`, and `firstOrCreate`. - Conditional updates via `updateOrCreate`. - Bulk operations `createMany`, `createManyQuietly`, `fetchOrNewUpMany`, `fetchOrCreateMany`, and `updateOrCreateMany`. ### Impact Applications are vulnerable if they pass unvalidated data or validated data that retains unknown properties to the model. This occurs because internal keys exist as instance properties, causing them to pass the `hasOwnProperty` check and bypass Lucid's default rejection of unknown properties. Applications utilizing strict allow lists for input validation that discard unknown properties are not affected. For example, if a developer passes `request.all()`, `request.except()` or a schema with `allowUnknownProperties` to `Model.create()`, the ORM's internal logic can be hijacked. Because the `Model.create()` > `save()` decision is based on `$isPersisted`, and `merge()` can assign to the own-property `$isPersisted`, an attacker who can inject `"$isPersisted": true` into the payload can force `save()` to take the UPDATE branch rather than the INSERT branch, while setting `$attributes` can bypass validators or field restrictions. ### Patches This issue has been patched in @adonisjs/lucid version `21.8.2` and `22.0.0-next.6`. Please upgrade to this version or later. Developers can mitigate this issue by strictly validating model inputs with an allow list that drops unknown keys if possible.

CVE-2026-22814 Affected @adonisjs/lucid Versions

2 component(s)
Fixed Versions:
21.8.222.0.0-next.6
Product / Package Ecosystem Affected Versions Fixed Version
@adonisjs/lucid
npm
< 21.8.2
21.8.2
@adonisjs/lucid
npm
≥ 22.0.0-next.0
< 22.0.0-next.6
22.0.0-next.6

References

Frequently Asked Questions

What is CVE-2026-22814?
CVE-2026-22814 is a security vulnerability in @adonisjs/lucid involving Mass Assignment in AdonisJS Lucid Allows Overwriting Internal ORM State under CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes.
Which @adonisjs/lucid versions are affected?
Affected versions include releases prior to 21.8.2, 22.0.0-next.6 across affected packages: @adonisjs/lucid.
What version fixes CVE-2026-22814?
Upgrading to 21.8.2, 22.0.0-next.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @adonisjs/lucid affected?
Yes, @adonisjs/lucid is affected in releases prior to 21.8.2, 22.0.0-next.6. Upgrade your dependency to 21.8.2, 22.0.0-next.6 or later.
What CWE is associated with CVE-2026-22814?
CVE-2026-22814 is classified under CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes (The product receives input from an upstream component that specifies multiple attributes, properties, or fields that are to be initialized or updated in an object, but it does not properly control which attributes can be modified.).
How can I check npm dependencies for CVE-2026-22814?
Run the dependency tree command: 'npm ls @adonisjs/lucid'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-g5gc-h5hp-555f",
  "modified" : "2026-01-13T21:41:38Z",
  "published" : "2026-01-13T20:37:09Z",
  "aliases" : [ "CVE-2026-22814" ],
  "summary" : "Mass Assignment in AdonisJS Lucid Allows Overwriting Internal ORM State",
  "details" : "### Summary\n**Description**\nA Mass Assignment (CWE-915) vulnerability in AdonisJS Lucid may allow a remote attacker who can influence data that is passed into Lucid model assignments to overwrite the internal ORM state. This may lead to logic bypasses and unauthorized record modification within a table or model. This affects @adonisjs/lucid through version 21.8.1 and 22.x pre-release versions prior to 22.0.0-next.6. This has been patched in @adonisjs/lucid versions 21.8.2 and 22.0.0-next.6.\n\n### Details\nA vulnerability in the `BaseModelImpl` class of `@adonisjs/lucid` may allow an attacker to overwrite internal class properties (such as `$isPersisted`, `$attributes`, or `$isDeleted`) when passing plain objects to model assignment methods.\n\nThe library relies on a `this.hasOwnProperty(key)` check to validate assignment targets. However, because internal ORM state properties are initialized as instance properties, they pass this check. Consequently, if an attacker can influence specific keys (like `$isPersisted`) into the payload passed to `merge()` or `$consumeAdapterResult()`, they can hijack the ORM's internal logic.\n\nThe exposed internal properties include:\n- `$attributes`: The raw storage for model data.\n- `$isPersisted`: Controls whether `save()` performs an `INSERT` or an `UPDATE`.\n- `$original`: Stores the original state of the record used to calculate changes.\n- `$isDeleted`: Prevents operations on deleted models.\n\nThis issue propagates to the entire write surface of the library, including:\n- Instance methods `fill` and  `merge`.\n- Single record creation methods `create`, `createQuietly`, `firstOrNew`, and `firstOrCreate`.\n- Conditional updates via `updateOrCreate`.\n- Bulk operations `createMany`, `createManyQuietly`, `fetchOrNewUpMany`, `fetchOrCreateMany`, and `updateOrCreateMany`.\n\n### Impact\nApplications are vulnerable if they pass unvalidated data or validated data that retains unknown properties to the model. This occurs because internal keys exist as instance properties, causing them to pass the `hasOwnProperty` check and bypass Lucid's default rejection of unknown properties.\n\nApplications utilizing strict allow lists for input validation that discard unknown properties are not affected.\n\nFor example, if a developer passes `request.all()`, `request.except()` or a schema with `allowUnknownProperties` to `Model.create()`, the ORM's internal logic can be hijacked. Because the `Model.create()` > `save()` decision is based on `$isPersisted`, and `merge()` can assign to the own-property `$isPersisted`, an attacker who can inject `\"$isPersisted\": true` into the payload can force `save()` to take the UPDATE branch rather than the INSERT branch, while setting `$attributes` can bypass validators or field restrictions.\n\n\n### Patches\nThis issue has been patched in @adonisjs/lucid version `21.8.2` and `22.0.0-next.6`. Please upgrade to this version or later.\n\nDevelopers can mitigate this issue by strictly validating model inputs with an allow list that drops unknown keys if possible.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@adonisjs/lucid"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "21.8.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 21.8.1"
    }
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@adonisjs/lucid"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "22.0.0-next.0"
      }, {
        "fixed" : "22.0.0-next.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/adonisjs/lucid/security/advisories/GHSA-g5gc-h5hp-555f"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-22814"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/adonisjs/lucid"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-915" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-01-13T20:37:09Z",
    "nvd_published_at" : "2026-01-13T20:16:11Z"
  }
}