Git Product home page Git Product logo

Comments (15)

josundt avatar josundt commented on August 24, 2024 2

@Sayan751 I found that [email protected] actually is the version installed in my node_modules folder.
Still the the npm warning appears.

Even if the latest aurelia-templating-resources release mitigates the problem, the reported vulnerability is for the aurelia-framework package (Cross-site Scripting in aurelia-framework).

Maybe new releases of the upstream dependencies with bumped version constraint for aurelia-templating-resources is required to resolve the npm warning?

aurelia-bootstrapper@bump
├ aurelia-templating-resources@^1.14.0
└ aurelia-framework@^bump
  └ aurelia-templating@^bump
    └ aurelia-templating-resources@^1.14.0

from framework.

mroeling avatar mroeling commented on August 24, 2024 2

@mroeling I think that's because you are credited in the reported vulnerability: GHSA-m6j2-v3gq-45r5.

A, yes, I've contributed by adding I think the last line to the references :) Thanks for pointing that out. But I had nothing to do with the original findings. So no, I don't think I'm the appropriate person in this matter...

Edit: I've sent the link to this thread to the raiser of the issue on the Aurelia forum.

from framework.

bigopon avatar bigopon commented on August 24, 2024 1

with [email protected] and [email protected] and [email protected], the reported vulnerability should be resolved.

Thanks @mroeling, @josundt for reporting & help resolving the issue & @Sayan751 for the discussion.

Though I'm not sure how we should actually make npm aware of this. @mroeling can you have a check and update the status?

from framework.

bigopon avatar bigopon commented on August 24, 2024 1

@milkshakeuk you can do the following:
main.js

import { HTMLSanitizer } from 'aurelia-templating-resources'
import createDOMPurify from 'dompurify'

export function configure(aurelia) {
  ...
  aurelia.container.registerSingleton(HTMLSanitizer, class MySanitizer {
    constructor() {
      this.purifier = createDOMPurify(window);
    } 
    sanitize(html) {
      return this.purifier.sanitize(dirty);
    }
  })
}

from framework.

jamesg1 avatar jamesg1 commented on August 24, 2024 1

A typescript version for the above

 import createDOMPurify from 'dompurify';
export class CustomHtmlSanitizer {
  purifier: createDOMPurify.DOMPurifyI;

  constructor() {
    this.purifier = createDOMPurify(window);
  }
  sanitize(html: string | Node) {
    return this.purifier.sanitize(html);
  }
}

aurelia.container.registerSingleton(HTMLSanitizer, CustomHtmlSanitizer);

from framework.

bigopon avatar bigopon commented on August 24, 2024

Thank you for reporting this issue. We will be releasing a new minor version of the templating package, with a throw, instead of the current way of doing it. After that, we will be upgrading the min dependency requirement here.

from framework.

josundt avatar josundt commented on August 24, 2024

@bigopon Any ETA for the templating package security update?

from framework.

Sayan751 avatar Sayan751 commented on August 24, 2024

@josundt The release is already out with v1.14.0: https://github.com/aurelia/templating-resources/releases/tag/1.14.0. I think this issue can now be closed.

Edit: Just realized, there might be some further changes that are required.

from framework.

mroeling avatar mroeling commented on August 24, 2024

with [email protected] and [email protected] and [email protected], the reported vulnerability should be resolved.

Thanks @mroeling, @josundt for reporting & help resolving the issue & @Sayan751 for the discussion.

Though I'm not sure how we should actually make npm aware of this. @mroeling can you have a check and update the status?

Even though I'm happy to see this resolved, @bigopon are you sure you meant to tag me in here? :)

from framework.

Sayan751 avatar Sayan751 commented on August 24, 2024

@mroeling I think that's because you are credited in the reported vulnerability: GHSA-m6j2-v3gq-45r5.

from framework.

bigopon avatar bigopon commented on August 24, 2024

I've submitted a resolution at github/advisory-database#175
Will update here.

from framework.

bigopon avatar bigopon commented on August 24, 2024

It's been merged github/advisory-database#175

This issue is resolved. Thanks everyone.

from framework.

milkshakeuk avatar milkshakeuk commented on August 24, 2024

@bigopon what's the official recommended way to fix the new error which is thrown is there a plugin you recommend for html sanitisation? I found this https://www.npmjs.com/package/@appex/aurelia-dompurify/v/0.5.0 but it's not been touched in a year.

from framework.

jamesg1 avatar jamesg1 commented on August 24, 2024

Hi it is a bit disappointing this security fix has resulted in existing functionality to stop working without much warning. The docs also should provide the solution above to the error.

from framework.

bigopon avatar bigopon commented on August 24, 2024

Hi @jamesg1 , thanks for the suggestion. Glad you got it working for you. I'd also say that if you don't have any HTML from user, maybe no need to use a sanitizer.
For the doc, cc @Vheissu

from framework.

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.