Code Injection Vulnerability in Obsidian Dataview

obsidian-dataview Updated 02 Oct 2025

Summary

24/05/2022
Yes i
High
7.8

CVE-2021-42057: Obsidian Dataview vulnerable to code injection due to unsafe eval. Affects obsidian-dataview versions < 0.4.13. Fixed in 0.4.13. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Obsidian Dataview is an open-source plugin for the Obsidian note-taking app that allows users to create dynamic and interactive Markdown files. It provides a powerful query language and data manipulation capabilities. However, a vulnerability has been discovered in versions up to 0.4.12-hotfix1 that allows for code injection through the unsafe use of the evalInContext function. This vulnerability can be exploited by crafting malicious Markdown files that execute arbitrary code when opened.

Vulnerability Detail

The code injection vulnerability in Obsidian Dataview arises from the insecure use of the evalInContext function. This function executes user input without proper validation, allowing an attacker to inject and execute arbitrary code. The impact of this vulnerability can be severe, as it enables an attacker to execute commands on the victim's system, potentially leading to unauthorized access, data leakage, or remote code execution. The Common Weakness Enumeration (CWE) identifier for this vulnerability is CWE-94.

How To Fix

Minimum fixed version

0.4.13

This is the first release that contains the fix.

npm install obsidian-dataview@0.4.13

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If updating to version 0.4.13 is not immediately feasible, a temporary workaround is to avoid opening untrusted Markdown files or files from unknown sources. Additionally, it is recommended to disable the Obsidian Dataview plugin until the package is updated to a secure version.

Conclusion

The code injection vulnerability in Obsidian Dataview exposes users to the risk of arbitrary code execution. It is crucial to update to version 0.4.13 or later to mitigate this vulnerability. If immediate updating is not possible, it is recommended to exercise caution when opening Markdown files and consider disabling the plugin until a secure version is available. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for obsidian-dataview →

Share this vulnerability

FAQ

Obsidian Dataview is a plugin for the Obsidian note-taking app that allows users to create dynamic and interactive Markdown files. It provides advanced querying and data manipulation capabilities.

The code injection vulnerability in Obsidian Dataview is caused by the unsafe use of the evalInContext function, which executes user input without proper validation. This allows an attacker to inject and execute arbitrary code.

The code injection vulnerability in Obsidian Dataview can lead to unauthorized access, data leakage, or remote code execution. An attacker can execute arbitrary commands on the victim's system, potentially compromising sensitive information or gaining control over the system.

To fix the code injection vulnerability, it is recommended to update Obsidian Dataview to version 0.4.13 or later. This version includes a mitigation for the vulnerability. Alternatively, you can disable the Obsidian Dataview plugin until a secure version is available.

A temporary workaround for the code injection vulnerability is to avoid opening untrusted Markdown files or files from unknown sources. Additionally, disabling the Obsidian Dataview plugin can mitigate the risk until a secure version is installed.

How To Fix

Minimum fixed version

0.4.13

This is the first release that contains the fix.

npm install obsidian-dataview@0.4.13

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback