fastify@5.3.1 vulnerabilities

Fast and low overhead web framework, for Node.js

  • latest version

    5.3.2

  • latest non vulnerable version

  • first published

    8 years ago

  • latest version published

    8 days ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the fastify package. This does not include vulnerabilities belonging to this package’s dependencies.

    How to fix?

    Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.

    Fix for free
    VulnerabilityVulnerable Version
    • H
    Improper Validation of Specified Type of Input

    fastify is an overhead web framework, for Node.js.

    Affected versions of this package are vulnerable to Improper Validation of Specified Type of Input in the validate() function, which does not sufficiently validate the content of messages with content-type-specifying headers. An attacker can bypass validation by providing a malformed content-type, such as by altering letter casing or adding whitespace before a semicolon. This is only exploitable if specific content types are defined in the schema for validation purposes, like in the content element of the structure below.

    fastify.post('/', {
      handler(request, reply) {
        reply.code(200).send(request.body)
      },
      schema: {
        body: {
          content: {
            'application/json': {
              schema: {
                type: 'object',
                properties: {
                  'foo': {
                    type: 'string',
                  }
                },
                required: ['foo']
              }
            },
          }
        }
      }
    })
    

    How to fix Improper Validation of Specified Type of Input?

    Upgrade fastify to version 5.3.2 or higher.

    >=5.0.0 <5.3.2