Vulnerabilities in pkg:npm/obsidian-dataview
PACKAGECVE-2021-42057 is a HIGH (CVSS 7.8) obsidian dataview vulnerable to code vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Obsidian dataview libraries in the npm ecosystem. The issue involves obsidian dataview vulnerable to code injection due to unsafe eval. Remediation is available by upgrading affected packages to version 0.4.13.
pkg:npm/obsidian-dataview
Vulnerability advisories affecting package pkg:npm/obsidian-dataview. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-xfg5-vrmc-24wc | CVE-2021-42057 | HIGH | Obsidian Dataview vulnerable to code injection due to unsafe eval |
CVE-2021-42057 at a Glance
Security Impact
CVSS: 7.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2021-42057
To remediate this vulnerability, upgrade all affected Obsidian dataview 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 obsidian-dataview@0.4.13
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls obsidian-dataview
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2021-42057, inspect your project dependencies using npm:
npm ls obsidian-dataview
Analyze the terminal output to locate any version of Obsidian dataview in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.4.13), your application is affected.
Note: The npm ls obsidian-dataview 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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Obsidian dataview, 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-2021-42057 Affected Obsidian dataview Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
obsidian-dataview
|
npm |
< 0.4.13
|
0.4.13
|
References
Frequently Asked Questions
What is CVE-2021-42057?
Which Obsidian dataview versions are affected?
What version fixes CVE-2021-42057?
Is obsidian-dataview affected?
What is the CVSS score of CVE-2021-42057?
What CWE is associated with CVE-2021-42057?
How can I check npm dependencies for CVE-2021-42057?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xfg5-vrmc-24wc",
"modified" : "2023-10-19T18:29:49Z",
"published" : "2022-05-24T19:19:42Z",
"aliases" : [ "CVE-2021-42057" ],
"summary" : "Obsidian Dataview vulnerable to code injection due to unsafe eval",
"details" : "Obsidian Dataview through 0.4.12-hotfix1 allows eval injection. The `evalInContext` function in executes user input, which allows an attacker to craft malicious Markdown files that will execute arbitrary code once opened. NOTE: 0.4.13 provides a mitigation for some use cases.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "obsidian-dataview"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.4.13"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.4.12-hotfix1"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-42057"
}, {
"type" : "WEB",
"url" : "https://github.com/blacksmithgu/obsidian-dataview/issues/615"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/blacksmithgu/obsidian-dataview"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-10-19T18:29:49Z",
"nvd_published_at" : "2021-11-04T21:15:00Z"
}
}