Commit 5733fcb
authored
fix(occ): prevent params command key from overriding validated allowlist command (#41577)
* fix(occ): prevent params command key from overriding validated allowlist command
OccController::execute() validated the URL-path $command against the
allowlist, then called array_merge(["command"=>$command], $params).
PHP's array_merge with string keys lets later values overwrite earlier
ones, so a "command" key in the POST body $params silently replaced the
validated command, allowing execution of any occ command.
Add unset($params["command"]) before the merge to strip any
attacker-supplied command key, ensuring the validated value is always
what reaches Symfony Console.
Signed-off-by: Thomas Müller <thomas.mueller@owncloud.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
* chore: add changelog entry for #41577
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
---------
Signed-off-by: Thomas Müller <thomas.mueller@owncloud.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>1 parent bfdf515 commit 5733fcb
3 files changed
Lines changed: 48 additions & 0 deletions
File tree
- changelog/unreleased
- core/Controller
- tests/Core/Controller
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
87 | 123 | | |
88 | 124 | | |
89 | 125 | | |
| |||
0 commit comments