Giter VIP home page Giter VIP logo

Comments (4)

dougwilson avatar dougwilson commented on April 28, 2024

Yes, there are many validator libraries you can use with express to suit your specific validation neeeds.

You may have opened this issue again the wrong repo as this is the express framework, and not an application that would be implementing some validation lib.

from express.

dougwilson avatar dougwilson commented on April 28, 2024

If you are looking for help on what lib you want to use in your app, feel free to post over in our discussion board https://github.com/expressjs/express/discussions

from express.

krzysdz avatar krzysdz commented on April 28, 2024

req.params should not be sanitized by Express. It should be just properly handled by the developer depending on the planned usage.

How do you know what the developer using Express wants to do with the received values? Different sanitization methods are required for different use cases (paths, data used in HTML, DB queries, etc.) and it would be easy to miss something. What if raw data is necessary (e.g. because it will be used in a safe way)?

from express.

AtilMohAmine avatar AtilMohAmine commented on April 28, 2024

Thank you for your valuable feedback. While I appreciate the concern, the proposed modifications to req.param aim to enhance security by incorporating validation for alphanumeric values. However, it's essential to note that Express deliberately avoids sanitizing req.params directly, as this allows developers to exercise greater control over the sanitization process based on their specific use cases. Different contexts may demand distinct sanitization methods (e.g., paths, HTML, or database queries), and enforcing a universal approach could inadvertently limit flexibility. By presenting raw data, Express empowers developers to make informed decisions about validation and modification tailored to their application's unique requirements. It's crucial to strike a balance between security measures and flexibility to accommodate diverse development scenarios effectively.

from express.

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.