ericcornelissen/webmangler

Comments in JavaScript be mangled if the comment contain a newline

Closed this issue · 0 comments

Bug Report

Description

When mangling a JavaScript script with comments, the language-js plugin might accidentally mangle in comments if the comment contains a newline.

Proof of Concept

  1. Have a JavaScript file with mangle-able JS in a multiline comment (/* */). For example:

    var foos = document.querySelectorAll(".cls-foo");
    /*
    var bars = document.querySelectorAll(".cls-bar");
    */
  2. Run WebMangler CLI (version 0.1.6) with WebMangler Core (version 0.1.24) and the default mangler plugins & default language plugins (at the exact versions found in the WebMangler Core package.json).

  3. Observe that the comments have been mangled. For the example above:

    var foos = document.querySelectorAll(".a");
    /*
    var bars = document.querySelectorAll(".b");
    */