CVE-2022-40277: Joplin Remote Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-mjr5-v9c9-mm7g
CVSS 7.8
CWE-20
Published
Advisory Summary

CVE-2022-40277 is a HIGH (CVSS 7.8) remote code execution vulnerability (CWE-20: Improper Input Validation) affecting Joplin libraries in the npm ecosystem. The issue involves joplin remote code execution. Remediation is available in the latest vendor maintenance releases.

CVE-2022-40277 at a Glance

CVE Identifier CVE-2022-40277
GHSA Identifier GHSA-mjr5-v9c9-mm7g
Severity HIGH
CVSS v3.1 Base Score 7.8
CWE Classification CWE-20: Improper Input Validation
Affected Product Joplin
Package Ecosystem npm
Published Date
Last Updated

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).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2022-40277

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

joplin fixed: Latest secure release
npm install joplin@Latest secure release
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 joplin

How to Check if You Are Affected

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

npm ls joplin

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

Note: The npm ls joplin 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Joplin, 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

Joplin version 2.8.8 allows an external attacker to execute arbitrary commands remotely on any client that opens a link in a malicious markdown file, via Joplin. This is possible because the application does not properly validate the schema/protocol of existing links in the markdown file before passing them to the `shell.openExternal` function.

CVE-2022-40277 Affected Joplin Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
joplin
npm
≤ 2.8.8

References

Frequently Asked Questions

What is CVE-2022-40277?
CVE-2022-40277 is a security vulnerability in Joplin involving Joplin Remote Code Execution under CWE-20: Improper Input Validation.
Which Joplin versions are affected?
Affected versions include releases prior to current release patches across affected packages: joplin.
What version fixes CVE-2022-40277?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is joplin affected?
Yes, joplin is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2022-40277?
CVE-2022-40277 has a CVSS v3.1 base score of 7.8 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2022-40277?
CVE-2022-40277 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check npm dependencies for CVE-2022-40277?
Run the dependency tree command: 'npm ls joplin'. 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-mjr5-v9c9-mm7g",
  "modified" : "2024-04-23T17:43:45Z",
  "published" : "2022-10-01T00:00:20Z",
  "aliases" : [ "CVE-2022-40277" ],
  "summary" : "Joplin Remote Code Execution",
  "details" : "Joplin version 2.8.8 allows an external attacker to execute arbitrary commands remotely on any client that opens a link in a malicious markdown file, via Joplin. This is possible because the application does not properly validate the schema/protocol of existing links in the markdown file before passing them to the `shell.openExternal` function.",
  "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" : "joplin"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "2.8.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-40277"
  }, {
    "type" : "WEB",
    "url" : "https://fluidattacks.com/advisories/skrillex"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/laurent22/joplin"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-23T17:43:45Z",
    "nvd_published_at" : "2022-09-30T17:15:00Z"
  }
}