{"id":27019,"date":"2014-01-01T05:58:35","date_gmt":"2014-01-01T05:58:35","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/secure-xml-rpc\/"},"modified":"2014-08-30T21:40:19","modified_gmt":"2014-08-30T21:40:19","slug":"secure-xml-rpc","status":"publish","type":"plugin","link":"https:\/\/test.wordpress.org\/plugins\/secure-xml-rpc\/","author":295019,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.0","stable_tag":"1.0.0","tested":"4.0.38","requires":"3.8","requires_php":"","requires_plugins":"","header_name":"Secure XML-RPC","header_author":"Eric Mann","header_description":"","assets_banners_color":"f1f1f1","last_updated":"2014-08-30 21:40:19","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/wordpress.org\/plugins\/secure-xmlrpc","header_plugin_uri":"http:\/\/wordpress.org\/plugins\/secure-xmlrpc","header_author_uri":"http:\/\/eamann.com","rating":3.7,"author_block_rating":0,"active_installs":60,"downloads":6930,"num_ratings":3,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":{"1.0.0":"<p>The hashing mechanism for generating authentication headers has changed slightly. Please refer to the FAWs for an example of how things work with a double-hash in the newest version.<\/p>","0.1.0":"<p>First Release<\/p>"},"ratings":{"1":"1","2":0,"3":0,"4":0,"5":"2"},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":"975920","resolution":"128x128","location":"assets","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":"975920","resolution":"256x256","location":"assets","width":256,"height":256}},"assets_banners":{"banner-772x250.png":{"filename":"banner-772x250.png","revision":"975920","resolution":"772x250","location":"assets","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.1.0","1.0.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"831036","resolution":"1","location":"assets","width":2192,"height":1122}},"screenshots":{"1":"The new Remote Publishing Permissions area of the user profile."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[710,2061,600,14731],"plugin_category":[38,54],"plugin_contributors":[79892],"plugin_business_model":[],"class_list":["post-27019","plugin","type-plugin","status-publish","hentry","plugin_tags-authentication","plugin_tags-oauth","plugin_tags-security","plugin_tags-xmlrpc","plugin_category-authentication","plugin_category-security-and-spam-protection","plugin_contributors-ericmann","plugin_committers-ericmann"],"banners":{"banner":"https:\/\/ps.w.org\/secure-xml-rpc\/assets\/banner-772x250.png?rev=975920","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/secure-xml-rpc\/assets\/icon-128x128.png?rev=975920","icon_2x":"https:\/\/ps.w.org\/secure-xml-rpc\/assets\/icon-256x256.png?rev=975920","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/secure-xml-rpc\/assets\/screenshot-1.png?rev=831036","caption":"The new Remote Publishing Permissions area of the user profile."}],"raw_content":"<!--section=description-->\n<p>Rather than sending usernames and passwords in plain text with every request, we're going to use a set of public\/secret keys to hash data and authenticate instead.<\/p>\n\n<p>On your WordPress profile, you will see a new \"Remote Publishing Permissions\" section listing out the applications that have permission to publish, along with their public and secret keys.<\/p>\n\n<p>New applications can be added whenever you want.  You can also change the names of applications, or revoke publishing permission by deleting them.<\/p>\n\n<h3>Additional Information<\/h3>\n\n<p>Lock graphic designed by Scott Lewis from the thenounproject.com<\/p>\n\n<!--section=installation-->\n<h4>Manual Installation<\/h4>\n\n<ol>\n<li>Upload the entire <code>\/secure-xml-rpc<\/code> directory to the <code>\/wp-content\/plugins\/<\/code> directory.<\/li>\n<li>Activate Secure XML-RPC through the 'Plugins' menu in WordPress.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>How do I use the new authorization?<\/dt>\n<dd><p>The old username\/password paradigm can still be used, but will result in a <code>X-Deprecated<\/code> header being returned by the server.<\/p>\n\n<p>From now on, you will send an <code>Authorization<\/code> header.  This header will be the publishing application's public key, two pipe (<code>|<\/code>) characters, and a hash of the application's secret key concatenated with the body of the request.<\/p><\/dd>\n<dt>How do I generate the message hash?<\/dt>\n<dd><p>Say your application has the following information:\n* Public Key: b730db0864b0d4453ba6a26ad6613cd4\n* Secret Key: 7647a19f5bf3e9fd001419900ad48a54<\/p>\n\n<p>And you want to make the following request (whitespace\/indentation added for readability, but is removed when calculating hashes):<\/p>\n\n<pre><code>&lt;?xml version=\"1.0\"?&gt;\n&lt;methodCall&gt;\n  &lt;methodName&gt;wp.getPosts&lt;\/methodName&gt;\n  &lt;params&gt;\n    &lt;param&gt;\n      &lt;value&gt;&lt;i4&gt;1&lt;\/i4&gt;&lt;\/value&gt;\n    &lt;\/param&gt;\n    &lt;param&gt;\n      &lt;value&gt;&lt;string&gt;&lt;\/string&gt;&lt;\/value&gt;\n    &lt;\/param&gt;\n    &lt;param&gt;\n      &lt;value&gt;&lt;string&gt;&lt;\/string&gt;&lt;\/value&gt;\n    &lt;\/param&gt;\n  &lt;\/params&gt;\n&lt;\/methodCall&gt;\n<\/code><\/pre>\n\n<p>Note that the second and third parameters (traditionally <code>username<\/code> and <code>password<\/code>) are empty.  Usernames and passwords can still be specified, but will result in the server returning an <code>X-Deprecated<\/code> header.<\/p>\n\n<p>Your Authorization header would thus become:<\/p>\n\n<pre><code>b730db0864b0d4453ba6a26ad6613cd4||3fac15f99f7a178f922bcc4942e62dc9001b2a45118fc3a6f3aebd77d25f4d58\n<\/code><\/pre>\n\n<p>The second part of the header is generated in PHP by calculating:<\/p>\n\n<pre><code>hash( 'sha256', '7647a19f5bf3e9fd001419900ad48a54' . hash( 'sha256', '7647a19f5bf3e9fd001419900ad48a54' . {request_body} ) )\n<\/code><\/pre>\n\n<p>WordPress will read the header and log you in as usual, but you never need to send your password across the wire.<\/p>\n\n<p>In this paradigm, application secret keys should <em>also<\/em> be treated as passwords - they are sensitive information!<\/p><\/dd>\n<dt>Why are we using the secret key twice?<\/dt>\n<dd><p>Some developers raised concerns about <a href=\"https:\/\/blog.whitehatsec.com\/hash-length-extension-attacks\/\">length extension attacks<\/a> in previous editions of the plugin. While length extension isn't strictly necessary when dealing with XML-based messaging, a double hash helps end the discussion around potentially-related vulnerabilities.<\/p>\n\n<p>The double-hash is similar to but simpler than HMAC and is fairly easy to implement in any programming language. Just note, PHP's <code>hash()<\/code> function returns a base64-encoded string, not a raw hash of the data passed in.<\/p><\/dd>\n<dt>Do I have to copy\/paste my application keys into remote systems?<\/dt>\n<dd><p>Not necessarily.<\/p>\n\n<p>The latest version of the plugin adds a new XML-RPC method to the system that allows for the generation of user-specific application keys remotely. <em>Please only ever call this method over a secure\/trusted network connection<\/em> when setting up an application for the first time.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>New: Add a custom RPC method for generating application keys remotely.<\/li>\n<li>Dev change: Move all functional implementations inside our pseudo-namespace.<\/li>\n<li>Dev change: Use a constant-time string comparison method for better security and less data leakage during authentication.<\/li>\n<li>Dev change: Use a double-hash to prevent any potential length-extension attacks.<\/li>\n<\/ul>\n\n<h4>0.1.0<\/h4>\n\n<ul>\n<li>First release<\/li>\n<\/ul>","raw_excerpt":"More secure wrapper for the WordPress XML-RPC interface.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/27019","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=27019"}],"author":[{"embeddable":true,"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/ericmann"}],"wp:attachment":[{"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=27019"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=27019"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=27019"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=27019"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=27019"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=27019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}