Why do we escapeshellarg the parts of occ commands?
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 4
- Forks
- 4
- Avg merge
- 9h 26m
- Merged PRs (30d)
- 1
Description
In lib/Occ.php function execute() we escapeshellarg the parts of the command to be executed.
We make exceptions to that for parts of occ commands that we know we need to send aalready enclosed in quotes, like:
--display-name='User One'
' '
'A value that has space in it'
It gradually gets more complicated to let through these string patterns and escapeshellarg everything else.
If you enable the testing app, and you know the admin password, then you can already do lots of nasty things to your system. If you know the admin password, then you may also have command line access to your system anyway - so you can type any command that you like.
So why do we try to protect occ command execution from command injection?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in lib/Occ.php at function execute() and trace how command parts are passed through escapeshellarg, including the listed quoted exceptions. Determine the security rationale and scope of the current behavior; done means reaching a documented decision about whether the protection should remain, change, or be removed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- cli, security
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100