Django-oscar: Anonymous order verification hash uses insecure md5

Created on 10 Apr 2018  路  3Comments  路  Source: django-oscar/django-oscar

In src/oscar/apps/order/abstract_models.py, the AbstractOrder model has a verification_hash method, which uses the insecure MD5 hashing algorithm to compute a verification code.

I Am Not A Cryptographer, but my spidey sense is tingling...

  • key = '%s%s' % (self.number, settings.SECRET_KEY) <- user already knows the number; hash input is a simple concatenation of number and secret key
  • hash = hashlib.md5(key.encode('utf8')) <- hash is also known to the user

Wouldn't that make the site-wide secret key recoverable from an anonymous order URL?

Most helpful comment

Thanks for reporting this. It is fixed in Oscar 1.5.3 which we've just released.

All 3 comments

Yep, this is an issue. Working on a patch.

Thanks for reporting this. It is fixed in Oscar 1.5.3 which we've just released.

Thanks for an extremely quick response and fix. It really speaks highly of the project.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maerteijn picture maerteijn  路  5Comments

lirlocker picture lirlocker  路  3Comments

maikhoepfel picture maikhoepfel  路  8Comments

elioscordo picture elioscordo  路  8Comments

jayvdb picture jayvdb  路  3Comments