Giter Club home page Giter Club logo

Comments (3)

okuryu avatar okuryu commented on June 2, 2024

As far as I know, you are the first person to use this on a non Node.js environment.

I'm not sure about v8js, but I think it should work if you use an older version like v2.x or v3.0.0.

from serialize-javascript.

alfredriesen avatar alfredriesen commented on June 2, 2024

If I remain on v3.0.0, then the Snyk audit does not pass.
Issues to fix by upgrading: Upgrade [email protected] to [email protected] to fix ✗ Arbitrary Code Injection (new) [High Severity][https://snyk.io/vuln/SNYK-JS-SERIALIZEJAVASCRIPT-570062] in [email protected] introduced by [email protected] and 1 other path(s)

I tried to update only minimist to v1.2.5 in yarn.lock . But Snyk continue reporting the vulnerable path. Do I have any other options?

from serialize-javascript.

alfredriesen avatar alfredriesen commented on June 2, 2024

As a workaround I implemented a bridge PHP - Javascript for this function "randomBytes":

On Javascript:

const crypto = {
    randomBytes: function (val) {
        let newBuffer = new Uint8Array (val)
        let bytesNumbers = global.randomBytes(val) // refers to PHP $randomBytes
        return newBuffer.map((number,index) => bytesNumbers[index])
    },
}

On PHP:

$randomBytes = function (int $length) {
      return array_map(function ($i) { return ord($i); }, str_split(random_bytes($length)));
};

Now I can update to v3.1.0

from serialize-javascript.

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.