Vulnerabilities in pkg:npm/@adonisjs/lucid
PACKAGECVE-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.
pkg:npm/@adonisjs/lucid
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
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.
npm install @adonisjs/lucid@21.8.2
npm install @adonisjs/lucid@22.0.0-next.6
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
CVE-2026-22814 Affected @adonisjs/lucid Versions
2 component(s)| 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?
Which @adonisjs/lucid versions are affected?
What version fixes CVE-2026-22814?
Is @adonisjs/lucid affected?
What CWE is associated with CVE-2026-22814?
How can I check npm dependencies for CVE-2026-22814?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}