Make WordPress Core

Opened 21 years ago

Closed 21 years ago

#1851 closed defect (bug) (fixed)

Cache exposes some user data

Reported by: ringmaster Owned by:
Priority: normal Milestone:
Component: Administration Version: 1.6
Severity: critical Keywords: bg|has-patch
Cc: Focuses:

Description

Using the new cache system, some sensitive user data is easier to obtain than before.

Steps:

  1. Guess a WordPress username (like "admin").
  2. Obtain an MD5 hash of that username, call it XX.
  3. Access a file named ​http://example.com/wp-content/cache/users/{XX}

The data exposed contains the database record for that user. At least, it exposes the user's email address. At worst, this could be used to reverse-engineer cookies that would allow enough access to change the password of that user.

Attached patch uses the database password to seed the hashes, making the filenames that contain this data more difficult to guess.

Consider adding .htaccess to the cache directory to prevent direct access/prevent directory browsing? Consider hashing the cache directory names to prevent directory guessing? Consider not caching user data?

Attachments (1)

cache.php.patch​ (968 bytes ) - added by ringmaster 21 years ago.
Add a little salt.

Download all attachments as: .zip

Change History (3)

@ringmaster
21 years ago

Add a little salt.

#1 @ryan
21 years ago

Also maybe put an index.php in the cache dirs.

#2 @ryan
21 years ago

  • Resolution → fixed
  • Status new → closed

(In [3017]) Obfuscate keys with some salt. Add empty index.php files to the cache dirs to prevent directory listings. Props to ringmaster. fixes #1851

Note: See TracTickets for help on using tickets.