Giter Club home page Giter Club logo

Comments (3)

aaugustin avatar aaugustin commented on July 29, 2024

Hrm. Interesting one. Thanks for reporting it.

django-sesame is already using what Python's base64 module calls "URL-safe" base-64 encoding.

We need two non alphanumeric characters to have a total of 26 + 26 + 10 + 2 = 64 in the alphabet. The safest choices are unreserved characters: - / . / _ / ~. _ is good. We can't use . because it's already used for telling v1 tokens apart from v2 tokens. This leaves a choice between - and ~ for the second character. I don't see why one would be safer than the other.

I'm disinclined to make changes here:

  • Thunderbird accepted the issue as a bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1418548
  • Youtube has the same issue, and I think they have more users than django-sesame ;-)
  • I have little evidence that the cure would be better than the disease
  • I like to tread carefully when security meets backwards-compatibility

from django-sesame.

aaugustin avatar aaugustin commented on July 29, 2024

If you like Russian roulette:

import base64
base64._urlsafe_encode_translation = bytes.maketrans(b'+/', b'~_')
base64._urlsafe_encode_translation = bytes.maketrans(b'~_', b'+/')

I wouldn't recommend this, though.

from django-sesame.

tasn avatar tasn commented on July 29, 2024

I guess I over-reacted. If Youtube also has it and Tbird already accepted it this can be closed. Sorry for the noise. :P

from django-sesame.

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.