CVE-2020-15092: @knight lab/timelinejs Cross-Site Scripting Vulnerability

HIGH
Advisory Identifier: GHSA-2jpm-827p-j44g
CVSS 7.2
CWE-79
Published
Advisory Summary

CVE-2020-15092 is a HIGH (CVSS 7.2) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting @knight lab/timelinejs libraries in the npm ecosystem. The issue involves stored xss in timelinejs3. Remediation is available by upgrading affected packages to version 3.7.0.

CVE-2020-15092 at a Glance

CVE Identifier CVE-2020-15092
GHSA Identifier GHSA-2jpm-827p-j44g
Severity HIGH
CVSS v3.1 Base Score 7.2
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product @knight lab/timelinejs
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H).

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

How to Fix CVE-2020-15092

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

@knight-lab/timelinejs fixed: 3.7.0
npm install @knight-lab/timelinejs@3.7.0
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 @knight-lab/timelinejs

How to Check if You Are Affected

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

npm ls @knight-lab/timelinejs

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

Note: The npm ls @knight-lab/timelinejs 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In @knight lab/timelinejs, 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

### Impact TimelineJS renders some user data as HTML. An attacker could implement an XSS exploit with maliciously crafted content in a number of data fields. This risk is present whether the source data for the timeline is stored on Google Sheets or in a JSON configuration file. Most TimelineJS users configure their timeline with a Google Sheets document. Those users are exposed to this vulnerability if they grant write access to the document to a malicious inside attacker, if the access of a trusted user is compromised, or if they grant public write access to the document. Some TimelineJS users configure their timeline with a JSON document. Those users are exposed to this vulnerability if they grant write access to the document to a malicious inside attacker, if the access of a trusted user is compromised, or if write access to the system hosting that document is otherwise compromised. Although the vulnerability has a [CVSS v3.1 base score of 7.2](https://www.first.org/cvss/calculator/3.1#CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H), this vulnerability has a severity of Moderate due to the likeliness of exploitation. ### Patches Version 3.7.0 of TimelineJS addresses this in two ways. 1. For content which is intended to support limited HTML markup for styling and linking, that content is "sanitized" before being added to the DOM. 1. For content intended for simple text display, all markup is stripped. Very few users of TimelineJS actually install the TimelineJS code on their server. Most users publish a timeline using a URL hosted on systems we control. The fix for this issue is published to our system such that **those users will automatically begin using the new code**. The only exception would be users who have deliberately edited the embed URL to "pin" their timeline to an earlier version of the code. Some users of TimelineJS use it as a part of a [wordpress plugin](https://wordpress.org/plugins/knight-lab-timelinejs/). Version 3.7.0.0 of that plugin and newer integrate the updated code. Users are encouraged to update the plugin rather than manually update the embedded version of TimelineJS. ### Workarounds To exploit this vulnerability, the attacker must have write access to the data source for the Timeline or the server which embeds the timeline. Thus, the only workaround is appropriate attention to securing write access to the Google Sheet or JSON file which serves as the data source. ### References For more about the release of TimelineJS which addresses this vulnerability, see the [Knight Lab website](https://knightlab.northwestern.edu/2020/07/09/timelinejs-update/index.html). A technical write-up of this vulnerability is available [here](https://zanderwork.com/blog/cve-2020-15092/). ### Acknowledgements This vulnerability was discovered by Zander Work ([@captainGeech42](https://twitter.com/captainGeech42)) of Oregon State University. ### For more information If you have any questions or comments about this advisory: * Open an issue in [GitHub](https://github.com/NUKnightLab/TimelineJS3/issues) * File a support request in our [helpdesk system](https://knightlab.zendesk.com/hc/en-us/requests/new)

CVE-2020-15092 Affected @knight lab/timelinejs Versions

1 component(s)
Fixed Versions:
3.7.0
Product / Package Ecosystem Affected Versions Fixed Version
@knight-lab/timelinejs
npm
< 3.7.0
3.7.0

References

Frequently Asked Questions

What is CVE-2020-15092?
CVE-2020-15092 is a security vulnerability in @knight lab/timelinejs involving Stored XSS in TimelineJS3 under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which @knight lab/timelinejs versions are affected?
Affected versions include releases prior to 3.7.0 across affected packages: @knight-lab/timelinejs.
What version fixes CVE-2020-15092?
Upgrading to 3.7.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @knight-lab/timelinejs affected?
Yes, @knight-lab/timelinejs is affected in releases prior to 3.7.0. Upgrade your dependency to 3.7.0 or later.
What is the CVSS score of CVE-2020-15092?
CVE-2020-15092 has a CVSS v3.1 base score of 7.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2020-15092?
CVE-2020-15092 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check npm dependencies for CVE-2020-15092?
Run the dependency tree command: 'npm ls @knight-lab/timelinejs'. 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-2jpm-827p-j44g",
  "modified" : "2021-01-07T23:47:19Z",
  "published" : "2020-07-09T18:28:07Z",
  "aliases" : [ "CVE-2020-15092" ],
  "summary" : "Stored XSS in TimelineJS3",
  "details" : "### Impact\nTimelineJS renders some user data as HTML. An attacker could implement an XSS exploit with maliciously crafted content in a number of data fields. This risk is present whether the source data for the timeline is stored on Google Sheets or in a JSON configuration file.\n\nMost TimelineJS users configure their timeline with a Google Sheets document. Those users are exposed to this vulnerability if they grant write access to the document to a malicious inside attacker, if the access of a trusted user is compromised, or if they grant public write access to the document.\n\nSome TimelineJS users configure their timeline with a JSON document. Those users are exposed to this vulnerability if they grant write access to the document to a malicious inside attacker, if the access of a trusted user is compromised, or if write access to the system hosting that document is otherwise compromised.\n\nAlthough the vulnerability has a [CVSS v3.1 base score of 7.2](https://www.first.org/cvss/calculator/3.1#CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H), this vulnerability has a severity of Moderate due to the likeliness of exploitation.\n\n### Patches\nVersion 3.7.0 of TimelineJS addresses this in two ways. \n\n1. For content which is intended to support limited HTML markup for styling and linking, that content is \"sanitized\" before being added to the DOM.\n1. For content intended for simple text display, all markup is stripped. \n\nVery few users of TimelineJS actually install the TimelineJS code on their server. Most users publish a timeline using a URL hosted on systems we control. The fix for this issue is published to our system such that **those users will automatically begin using the new code**. The only exception would be users who have deliberately edited the embed URL to \"pin\" their timeline to an earlier version of the code.\n\nSome users of TimelineJS use it as a part of a [wordpress plugin](https://wordpress.org/plugins/knight-lab-timelinejs/). Version 3.7.0.0 of that plugin and newer integrate the updated code. Users are encouraged to update the plugin rather than manually update the embedded version of TimelineJS.\n\n### Workarounds\nTo exploit this vulnerability, the attacker must have write access to the data source for the Timeline or the server which embeds the timeline.\n\nThus, the only workaround is appropriate attention to securing write access to the Google Sheet or JSON file which serves as the data source.\n\n### References\nFor more about the release of TimelineJS which addresses this vulnerability, see the [Knight Lab website](https://knightlab.northwestern.edu/2020/07/09/timelinejs-update/index.html).\n\nA technical write-up of this vulnerability is available [here](https://zanderwork.com/blog/cve-2020-15092/).\n\n### Acknowledgements\n\nThis vulnerability was discovered by Zander Work ([@captainGeech42](https://twitter.com/captainGeech42)) of Oregon State University.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [GitHub](https://github.com/NUKnightLab/TimelineJS3/issues)\n* File a support request in our [helpdesk system](https://knightlab.zendesk.com/hc/en-us/requests/new)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@knight-lab/timelinejs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.7.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/NUKnightLab/TimelineJS3/security/advisories/GHSA-2jpm-827p-j44g"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-15092"
  }, {
    "type" : "WEB",
    "url" : "https://knightlab.northwestern.edu/2020/07/09/timelinejs-update/index.html"
  }, {
    "type" : "WEB",
    "url" : "https://knightlab.northwestern.edu/posts"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-07-09T18:27:39Z",
    "nvd_published_at" : null
  }
}