Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: special EventEmitter keys leak information about other rules #9328

Merged
merged 4 commits into from
Sep 27, 2017

Commits on Sep 27, 2017

  1. Fix: special EventEmitter keys leak information about other rules

    `Linter` uses Node's `EventEmitter` API to register listeners for rules. However, the `EventEmitter` API has a few problems for this use case:
    
    * `EventEmitter` has three "special" events (`newListener`, `removeListener`, and `error`) which are called when something happens with another listener. This is undesirable because `Linter` allows rules to register listeners for arbitrary string events, and we don't want rule listeners to be able to detect each other.
    * `EventEmitter` calls listeners with a `this` value of the event emitter itself. This is undesirable because this would allow rules to modify or tamper with listeners registered by other rules.
    
    This commit fixes the problem by updating `Linter` to use a custom event-emitting object with a similar API, rather than `EventEmitter` itself.
    not-an-aardvark committed Sep 27, 2017
    Configuration menu
    Copy the full SHA
    5dc8939 View commit details
    Browse the repository at this point in the history
  2. Improve sinon usage

    not-an-aardvark committed Sep 27, 2017
    Configuration menu
    Copy the full SHA
    3ae72a3 View commit details
    Browse the repository at this point in the history
  3. Fix tests on Node 4

    not-an-aardvark committed Sep 27, 2017
    Configuration menu
    Copy the full SHA
    f6fe282 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0c82e73 View commit details
    Browse the repository at this point in the history