Git Product home page Git Product logo

Comments (3)

mikesamuel avatar mikesamuel commented on May 2, 2024

Thanks for giving it a read.

attacks based on the intersection of Crypto and Compression

I'm afraid I'm unfamiliar with the specifics of Node.js that make it particularly vulnerable to this. Where might I may find more on this topic?

Denial of Service attacks

Agreed. This may be a bit of a Google-specific blind spot because we tend to handle DOS mostly in the reverse proxy. How do existing node projects deal with this? Is it usually handled by the app container?

Re other availability problems, we didn't spend much time on runaway computations either, like crafted inputs reaching badly written RegExps causing excessive backtracking.
Are there ways to tweak how the node runtime deals with runaway threads?

from node-sec-roadmap.

jasnell avatar jasnell commented on May 2, 2024

I'm afraid I'm unfamiliar with the specifics of Node.js that make it particularly vulnerable to this.

To be certain, Node.js is not any more vulnerable to this than any other platform. The basic idea is that when using transfer compression over a TLS connection, if the attacker is able to control any of the information within the encrypted and compressed data, then it can use various statistical analysis methods to derive the other content simply by looking at the compression ratios. This, for instance, is why HTTP/2 forbids using TLS compression and is why Node.js has disabled TLS compression by default. There are ways, however, in which users can get in to trouble still, however. Again, it is not something that is particularly unique to Node.js, but it is worth at least mentioning.

Here's one resource to begin researching: http://breachattack.com/resources/

Agreed. This may be a bit of a Google-specific blind spot because we tend to handle DOS mostly in the reverse proxy. How do existing node projects deal with this? Is it usually handled by the app container?

To be absolutely honest, dealing with DOS at the edge is the best practice for Node.js also. Node.js itself has a variety of shortcomings when it comes to how it interfaces with the network -- for instance, libuv will accept any connection from any client causing resources to be consumed prior to any user code being invoked. While this can be managed and while idle sockets are thankfully not that expensive of a resource to maintain, it is a vector that can be leveraged by an attacker. Node.js generally has very few protections built-in to prevent a malicious party from consuming significant resources.

from node-sec-roadmap.

mikesamuel avatar mikesamuel commented on May 2, 2024

Node.js generally has very few protections built-in to prevent a malicious party from consuming significant resources.

Maybe it's worth noting this when contrasting client- and server-side JS. Something like

Client-side, a script that consumes too much processor in a single event loop run causes the browser to halt all script execution for that document.
Node.js has few ways to manage runaway computations on the server.

and refer to it from a new threat-DOS which says something like

Denial of Service

Denial of service occurs when an authorized user cannot access a system.

"Denial of service" is most often associated with flooding a network endpoint with
many bogus requests so it cannot respond to the smaller number of legitimate
requests but there are other vectors:

  • Supplying over-large inputs to super-linear (> O(n)) algorithms
  • Supplying crafted strings to ambiguous RegExps causing [excessive backtracking][].
  • Causing the server to use too many of a finite resource like file descriptors causing
    threads to block.
  • Tar-pitting: causing the server itself to issue a network to an endpoint you control and
    responding slowly.

Additional risk: Integrity depends on Availability

A transactional requirement is when two or more effects have to happen together or not at all.

If there is a transactional requirement, and an attacker can cause computation to halt
after part of the transaction, and halting the computation does not roll-back then a
breach of availability can become a breach of integrity.

Client-side, runaway computations rarely translate into an integrity violation since transactional requirements are typically maintained on the server.
Server-side, we would expect to find more code that uses ad-hoc methods to maintain transactional requirements so unfinished computations are more likely to violate system integrity.

Risk / severity TBD.
"""

from node-sec-roadmap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.