Git Product home page Git Product logo

Comments (2)

ericz avatar ericz commented on June 20, 2024

Hey tom,

Yes this is a fix that we should be implementing ("validate incoming streams" and kill it if it is sending too much data to prevent overuse of server resources).

If you made a function call with a giant amount of parameter data, this won't be synchronous however because the transfer of that data and storing it in memory on the server is all asynchronous. The server will not wait synchronously for the parameters of a function to load fully. That function will simply be called after all data is loaded into memory. The only process there that is synchronous is the deserialization, which may be a problem.

However the issue is still that the memory can be swamped as that data WILL be stored in memory.

Excellent point. I didn't think of this method in our previous discussions.

from now.

ericz avatar ericz commented on June 20, 2024

This might not be possible.

Socket.io exposes incoming data not as a stream but as discrete messages. Any validation we write would have to be after the message has been accepted. We could possibly intercept a malicious message before it gets JSON.parsed which would save us some time but even then the damage to memory use would've occured.

Socket.io v0.7 will be exposing lower level things like the parser so that will be easy to implement (will not have to fork socket.io) in the new version.

In any case this is really more of a socket.io issue so I am closing for now.

Thanks for the issue tom.

from now.

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.