Giter Club home page Giter Club logo

Comments (4)

mashpie avatar mashpie commented on July 16, 2024

Thanks for pointing. If you have any further details to share or even a POC, please send them by email before disclosing.
Meanwhile I'll test for traversal vulnerability by myself.

from i18n-node.

mashpie avatar mashpie commented on July 16, 2024

So far I was not able to escape from the locales directory. Any provided locale (be it from accept-header, cookie, query parameter or code) has to match to one of configured locales, ie.:

const i18n = new I18n({
  locales: ['en', 'de'],
  directory: './translations'
})

The first locale will act as default for any "unknown" or manipulated locale. Thus, providing a locale like '../en' or '../de' or '../../' will result in using 'en' with reading/writing the file ./translations/en.json relative to process.env.PWD

Even without explicit config, i18n uses 'en' as default locale and 'locales' as default directory. Example:

const i18n = new I18n({})

can only use ./locales/en.json for any given locale.

I am about to add another test as prove for those cases. And I think there is still room for improving parameter sanitizing and filesystem operations in general.

from i18n-node.

francislz avatar francislz commented on July 16, 2024

@mashpie the tests on my side followed the same logic as yours and I was not able to escape from the locales directory as well. I think it is safe to assume its a false positive. Thanks for the fast response, btw :D

from i18n-node.

mashpie avatar mashpie commented on July 16, 2024

@francislz Thanks for your effort, I am glad to hear that. Let's keep this issue open for me to further improve sanitizing.

from i18n-node.

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.