Make WordPress Core

Opened 21 years ago

Closed 21 years ago

Last modified 20 years ago

#2273 closed defect (bug) (fixed)

Cookies override user specified in XML-RPC post data

Reported by: skeltoac Owned by: ryan
Priority: high Milestone:
Component: Security Version: 2.0
Severity: major Keywords: bg|has-patch bg|2nd-opinion bg|dev-feedback
Cc: Focuses:

Description

Working on #2241, I tested XMLRPC using Performancing/Firefox. I set up the XMLRPC client to use a login with Author caps (no unfiltered_html). My posts showed under the correct author. My HTML was unfiltered when I posted, but it should have been filtered. My browser was still logged in as admin (unfiltered_html) and Performancing was sending those cookies with the XMLRPC requests. Result: post saved under correct user but assuming caps due to cookie.

Wordpress should not authenticate with cookies when handling an XMLRPC request. i also sent a message to the Performancing dev (Jed Brown) but we should fix the core as well.

I'm working on the patch.

Attachments (2)

xmlrpc-auth.diff (6.3 KB ) - added by skeltoac 21 years ago.
oops.diff (329 bytes ) - added by skeltoac 21 years ago.

Download all attachments as: .zip

Change History (16)

#1 @skeltoac
21 years ago

no-cookies.diff defines a contant before anything else is done by xmlrpc.php, and checks that constant before using the cookies to log the user in. There is much more to be done.

#2 @davidhouse
21 years ago

  • Keywords bg|has-patch bg|reporter-feedback bg|2nd-opinion added

How does XMLRPC authenticate if its not through cookies? IMO this is a performancing bug, or you shouldn't be trying to run two users off one browser (so it would be invalid).

#3 @davidhouse
21 years ago

  • Keywords bg|has-patch removed

Removing bg|has-patch as your patch doesn't fix the problem in its entirety, as you've stated.

#4 @skeltoac
21 years ago

  • Keywords bg|has-patch added; bg|reporter-feedback bg|2nd-opinion removed
  • Owner changed from skeltoac to ryan

Sorry David :-) This one's done.

#5 @davidhouse
21 years ago

Hehe, that was my mistake :P I accidentally added bg|has-patch, not you.

#6 @davidhouse
21 years ago

  • Keywords bg|2nd-opinion bg|dev-feedback added
  • Milestone 2.0.12.1

Probably too much new code here for 2.0.1. Discuss.

#7 @ryan
21 years ago

  • Milestone 2.12.0.1

I think this needs to be fixed, even if it is a non-trivial amount of code. This bug has been reported many, many times. Let's commit and test the hell out of it.

#8 @ryan
21 years ago

  • Resolutionfixed
  • Status newclosed

(In [3430]) Make the xmlrpc user the current user. fixes #2273

#9 @skeltoac
21 years ago

  • Resolution fixed
  • Status closedreopened

Leftover error_log() call.

@skeltoac
21 years ago

#10 @skeltoac
21 years ago

I tested this with Performancing, using metaweblog API and Blogger API, while the browser was logged in as admin. It honored the user's caps regardless of the cookies. Other clients should be tested as well.

#11 @davidhouse
21 years ago

  • Milestone 2.0.12.1

Probably too much new code here for 2.0.1. Discuss.

#12 @davidhouse
21 years ago

  • Milestone 2.12.0.1

Woah. I totally didn't post that last comment.

#13 @ryan
21 years ago

  • Resolutionfixed
  • Status reopenedclosed

(In [3431]) Remove debug cruft. fixes #2273

#14 @(none)
20 years ago

  • Milestone 2.0.1

Milestone 2.0.1 deleted

Note: See TracTickets for help on using tickets.