Scenario
I am making a wordpress plugin for my own sites that needs access to the site's main .htaccess
file.
Via an install script I can modify the .htaccess
from 644
to 664
which allows my server (apache2) to write to the .htaccess
directly.
Question
What I'm concerned about is the limitation of security. Am I opening myself up to a flurry of potential attacks here? If so what is a better suggestion for making my .htaccess
writable by wordpress ie. apache?
EDIT
The apache2 user is www-data
on one server but is a different user on a different server depending on the host's settings. I need to be prepared for this.
permissions.sh
which rewrites the.htaccess
to 0664. I'm just concerned what risk this may open me up to..htaccess
writable in the first place is no doubt the immediate concern (many on WordPress SE recommend locking.htaccess
down so that it is not editable - which means WP can't update the file). Also, if you are distributingpermissions.sh
- how accessible is this? Is this removed from the server after installation?permissions.sh
is the that the recursive owner of the WP directory will run it. 1) User downloads git repo for WP plugin 2) user runspermissions.sh
3) user installs plugin from WP dashboard. I MAY be able tochmod
to 664, write to files, then use PHPchmod
back to 644 but am I overthinking this?