{"id":8800,"date":"2014-11-11T15:44:34","date_gmt":"2014-11-11T15:44:34","guid":{"rendered":"https:\/\/wp.okra.host\/article\/enabling-write-access\/"},"modified":"2021-03-07T14:51:58","modified_gmt":"2021-03-07T13:51:58","slug":"enabling-write-access","status":"publish","type":"ht_kb","link":"https:\/\/kb.okra.host\/de\/article\/enabling-write-access\/","title":{"rendered":"Freigabe des Schreibzugriffs"},"content":{"rendered":"<h2 id=\"overview\" >Overview<\/h2>\n<p>The web server operates in a dual-user mode for enhanced security. In order for a web application to\u00a0access your filesystem, specific permissions must be granted.<\/p>\n<h2 id=\"solution\" >Solution<\/h2>\n<p><a title=\"Writing to files\" href=\"https:\/\/kb.okra.host\/php\/writing-to-files\/\">Change permissions<\/a> on necessary files to <a title=\"Permissions overview\" href=\"https:\/\/kb.okra.host\/guides\/permissions-overview\/\">717 or 777<\/a>. For WordPress, <code>wp-content\/uploads\/<\/code> and <code>wp-content\/themes\/<\/code>\u00a0 should be changed recursively to allow media uploads and theme editing in-browser. If plugin editing is desired, change permissions recursively on\u00a0<code>wp-content\/plugins<\/code> as well.<\/p>\n<p>The same process may be done for any other plugins or themes than require write-access to any\u00a0folder not covered above.<\/p>\n<blockquote>\n<p><span style=\"color: #0000ff\"><strong>Important:<\/strong><\/span> traditionally, PHP and site files operated under one user, for two major reasons: <em>accountability<\/em> and <em>ease-of-use<\/em>. Accountability in that service providers providing unlimited resources can better target accounts that are unsuitable for a truly &#8220;unlimited&#8221; hosting plan (ie. consuming too many cpu resources). Running all WordPress applications under the same user allows administrators to flag abusive accounts that might lie above a <a href=\"http:\/\/en.wikipedia.org\/wiki\/The_Bell_Curve\">bell curve<\/a>. Second, it&#8217;s easy to update files when all files accessed by the web server are owned by the same user. Permissions are <a title=\"Permissions overview\" href=\"https:\/\/kb.okra.host\/guides\/permissions-overview\/\">not an issue<\/a>. Just let the user update WordPress from WordPress&#8217; dashboard and done.<\/p>\n<p><em>But there&#8217;s a huge problem running under one user!<\/em> Any request on the domain, whether legitimate or forged,\u00a0can be leveraged by an attacker. Because, the HTTP request assumes the same ownership as you, any PHP exploit[<a href=\"http:\/\/www.cvedetails.com\/vulnerability-list\/vendor_id-74\/product_id-128\/PHP-PHP.html\">1<\/a>][<a href=\"https:\/\/cve.mitre.org\/cgi-bin\/cvekey.cgi?keyword=wordpress\">2<\/a>][<a href=\"http:\/\/cve.mitre.org\/cgi-bin\/cvekey.cgi?keyword=drupal\">3<\/a>][<a href=\"http:\/\/www.cvedetails.com\/vulnerability-list\/vendor_id-5025\/Zend.html\">4<\/a>][<a href=\"http:\/\/www.cvedetails.com\/vulnerability-list\/vendor_id-3496\/product_id-6129\/Joomla-Joomla.html\">5<\/a>] can be first leveraged to gain access,\u00a0<em>then bootloaders<\/em> (simple\u00a0file managers) can be injected\u00a0into any PHP script allowing an attacker to upload malicious scripts elsewhere so long as he knows the special key.\u00a0<span style=\"text-decoration: underline\"><em><strong>Exploits do happen. Update\u00a0regularly!<\/strong><\/em><\/span><\/p>\n<p>By running as a separate user, the window of\u00a0opportunity to exploit is limited. Only files that you <em>explicitly authorize write access<\/em> can be modified by a PHP application. If a hacker can&#8217;t modify the file, then the hacker can&#8217;t inject a bootloader or other malicious code. Only let the web server write to locations that are necessary for operation. Setting permissions to 717 on only those directories\/files that are updated regularly by a PHP application\u00a0is a <a title=\"Permissions overview\" href=\"https:\/\/kb.okra.host\/guides\/permissions-overview\/\">great solution<\/a> to reduce your surface exposure. But, don&#8217;t set these permissions on all files or your account is just as insecure as running under\u00a0one\u00a0user.<\/p>\n<\/blockquote>\n<h2 id=\"see-also\" >See Also<\/h2>\n<ul>\n<li>PHP: <a title=\"Writing to files\" href=\"https:\/\/kb.okra.host\/php\/writing-to-files\/\">Writing to files<\/a><\/li>\n<li>PHP: <a title=\"open_basedir restriction messages\" href=\"https:\/\/kb.okra.host\/php\/open_basedir-restriction-messages\/\">open_basedir restriction message<\/a><\/li>\n<li>Guides:\u00a0<a title=\"Permissions overview\" href=\"https:\/\/kb.okra.host\/guides\/permissions-overview\/\">Permission overview<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview The web server operates in a dual-user mode for enhanced security. In order for a web application to\u00a0access your filesystem, specific permissions must be granted. Solution Change permissions on necessary files to 717 or 777. For WordPress, wp-content\/uploads\/ and wp-content\/themes\/\u00a0 should be changed recursively to allow media uploads and&#8230;<\/p>","protected":false},"author":1,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[69],"ht-kb-tag":[],"class_list":["post-8800","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-wordpress"],"_links":{"self":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8800","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/comments?post=8800"}],"version-history":[{"count":1,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8800\/revisions"}],"predecessor-version":[{"id":8801,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8800\/revisions\/8801"}],"wp:attachment":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/media?parent=8800"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb-category?post=8800"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb-tag?post=8800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}