Home » Blogs » Andreas Åkre Solberg [1]'s blog

Vulnerable token creation in PHP OAuth library

Submitted by Andreas Åkre Solberg [1] on 30 April, 2009 - 08:41

Do not use the SimpleOAuthDataStore that is included in the PHP OAuth library. The reason is the obvious relation between the key and the secret. Hash functions are fun to use, isn't they?

The developer should very well know that md5(md5( is insecure, he/she should use md5(md5(md5( ;P

function new_token($consumer, $type="request") {/*{{{*/
  $key = md5(time());
  $secret = time() + time();
  $token = new OAuthToken($key, md5(md5($secret)));
  • OAuth
  • Andreas Åkre Solberg [1]'s blog
  • simpleSAMLphp
    • Deployments
    • Documentation
    • Logo
    • Mailinglist
    • News
    • Release plan
    • Translation
    • Developers
    • Commercial Support
    • DokuWiki
  • More software
    • SAML 2.0 Debugger
    • foodle
      • Installing Foodle
    • RadSecProxy
    • javamellon
    • mod_mellon
    • phpmellon
    • wikiplex
    • xmlseclibs
      • Mailinglist
  • Federated software
  • Attributes
  • Federations
    • Kalmar Union
      • Metadata access
      • Metadata details
      • Technical notes
    • eduGAIN
    • eduroam
    • MinID
  • Categories
  • GN3 Identity Federations
    • Work Plan Y2
    • Meetings
    • Sub-tasks
      • Metadata distribution
        • Simple Model
        • Aggregator testing
        • Aggregator req
      • Virtual Organizations
        • Attribute aggr
        • VO Def.
        • SWITCH GMT Demo
        • OAuth Demo
        • OAuth Trust
        • GMT Test Report
        • Front-channel attribute aggr. task descr.
        • OAuth Attribute Spec
      • Harmonization
      • Beyond WebSSO
        • Oauth CLI
      • User-centric
        • OpenID Federations
        • User-Centric Tech
      • Federation Lab
  • Anatomy of SAML
    • AuthnRequest
    • Response
  • SAML Examples
  • Slides
2007-2008 © UNINETT