Code Monkey home page Code Monkey logo

Comments (3)

ycrumeyrolle avatar ycrumeyrolle commented on June 18, 2024

Generally speaking, getting the raw bytes via ValueSpan and then using SequenceEqual probably isn't what you want to do unless you control the input or only want to support the exact bytes.

I want to support the exact match as the propertie names are registred values.
But...
as defined in the JWS RFC,

For security reasons, the representations of these names must be compared verbatim after performing any escape processing

So I have to support escaped properties.
The properties detection may be rewrite with ValueTextEqual instead of bytes comparison as proposed.

Also, is the JSON input here trusted or known to be valid UTF-8?

The JSON input is not trusted at all. Even if there is a signature validation, we have to read a part of the JSON before.

It should be a valid UTF-8 encoded string, but it may be a malicious string.
Do you have any example of malformed UTF-8 that may cause security issue?

from jwt.

ahsonkhan avatar ahsonkhan commented on June 18, 2024

It should be a valid UTF-8 encoded string, but it may be a malicious string.

What do you mean by malicious?

Do you have any example of malformed UTF-8 that may cause security issue?

I don't know. I would assume yes. Within the context of matching for equality on known utf8 bytes, it shouldn't matter.

from jwt.

ycrumeyrolle avatar ycrumeyrolle commented on June 18, 2024

Fixed by #325

from jwt.

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.