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 JSDOM transative vulnerability #7510

Merged
merged 2 commits into from
Jan 8, 2022

Conversation

avra-m3
Copy link
Contributor

@avra-m3 avra-m3 commented Nov 22, 2021

We noticed a transitive vulnerability in our automated npm audit checks.

It would be good if we could get this fixed. Ran tests and it looked fine, not sure what uses jsdom to be able to test any behavior has changed directly.

If you can point me at the features that depend on jsdom happy to test them directly and add any required test cases.

Cheers.

For reference

node_modules/json-schema
  jsprim  0.3.0 - 2.0.1
  Depends on vulnerable versions of json-schema
  node_modules/jsprim
    http-signature  1.0.0 - 1.3.5
    Depends on vulnerable versions of jsprim
    node_modules/http-signature
      request  >=2.66.0
      Depends on vulnerable versions of http-signature
      node_modules/request
        jsdom  9.10.0 - 16.5.3
        Depends on vulnerable versions of request
        node_modules/fabric/node_modules/jsdom
          fabric  >=2.4.0
          Depends on vulnerable versions of jsdom
          node_modules/fabric

@andtii
Copy link

andtii commented Nov 22, 2021

Yes we are doing a security review of all our deps and this is the last one having issues. Please get this in
image

@asturur
Copy link
Member

asturur commented Nov 22, 2021

Yeah i can get this in, if it does not cut any meaningfull node version.
It cuts node8 we don't care.
Are you using fabricJS in the browser only or on the server?
Are you aware that JSDOM won't get included in the bundle if mocked out correctly?

@asturur
Copy link
Member

asturur commented Nov 22, 2021

Please remove the minor version bumb and i ll merge ( need to look into why tests are failing )

@asturur
Copy link
Member

asturur commented Nov 22, 2021

this
https://github.com/fabricjs/fabric.js/pull/7510/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R85
would become >= 10

@avra-m3
Copy link
Contributor Author

avra-m3 commented Nov 24, 2021

Alright, on it now :), sorry for the delay.

@avra-m3
Copy link
Contributor Author

avra-m3 commented Nov 24, 2021

Updated PR

@asturur
Copy link
Member

asturur commented Nov 25, 2021

@ShaMan123 and @melchiar i was thinking to merge this ( vulnerabilities need to be fixed even if they are not triggerable in an immediate way ).
Bumping this requires to release fabric 5.0, at this point i would declare the only breaking change node version.
I m unsure if is better to bump up a little be more and cut at 14?
node 10 last patch was april this year, node 12 will be end of live april next year. Seems dull suggesting people they can still use it.

@melchiar
Copy link
Member

I agree, better to bump the version up higher. There may be more vulnerabilities found with 10 or 12 that would then require we do yet another major version release.

@ShaMan123
Copy link
Contributor

+1
Let's take fabric to the future

@asturur
Copy link
Member

asturur commented Nov 26, 2021

Argh need to investigate tests.

@avra-m3
Copy link
Contributor Author

avra-m3 commented Nov 26, 2021

Hey @asturur, happy to investigate 🙂

@avra-m3
Copy link
Contributor Author

avra-m3 commented Nov 29, 2021

I can't see anything immediately obvious in the JSDom changelogs.

It appears the image loading behaviour of parseFromString has changed in jsdom at some point, and now just hangs attempting to retrieve the image.

I'll keep looking into a solution but not sure there is one.

@asturur
Copy link
Member

asturur commented Dec 3, 2021

there are 2 issues right now.
a setTimeout change that break the test, but that is our fault probably, a better test can be written.
The other is the handling of non available images

@avra-m3
Copy link
Contributor Author

avra-m3 commented Dec 8, 2021

there are 2 issues right now. a setTimeout change that break the test, but that is our fault probably, a better test can be written. The other is the handling of non available images

This setTimeout issue, I assume you mean the test having a timeout in general? Or is there another broken test I didn't see.

I think we can change the behaviour in jsdom to fix the missing image hanging, but I don't have time right now to look into it. I likely won't get time until christmas. .

@stale
Copy link

stale bot commented Dec 25, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue marked as stale by the stale bot label Dec 25, 2021
…entifier to determine behaviour and use a new property 'objectRole'
@stale stale bot removed the stale Issue marked as stale by the stale bot label Jan 5, 2022
@asturur
Copy link
Member

asturur commented Jan 8, 2022

Hi @avra-m3 sorry for the long time.
I'm merging this so you get credit for the work done, thank you.
But i m also immediately updating to node 14 minimum and jsdom 19.
There is no need to stay behind on those.

@asturur asturur merged commit 7bdac32 into fabricjs:master Jan 8, 2022
rockerBOO pushed a commit to rockerBOO/fabric.js that referenced this pull request Jan 12, 2022
@asturur asturur mentioned this pull request Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants