feat: Add getForbiddenFilenames to \OCP\Util and unify filename sanitizing - #45151
Closed
susnux wants to merge 6 commits into
Closed
feat: Add getForbiddenFilenames to \OCP\Util and unify filename sanitizing#45151susnux wants to merge 6 commits into
susnux wants to merge 6 commits into
Conversation
susnux
force-pushed
the
fix/ensure-blacklist-is-honored
branch
7 times, most recently
from
May 2, 2024 20:31
acff472 to
059efb2
Compare
susnux
force-pushed
the
fix/ensure-blacklist-is-honored
branch
from
May 2, 2024 20:48
059efb2 to
54f89f7
Compare
susnux
requested review from
a team,
ArtificialOwl,
blizzz,
icewind1991 and
nfebe
and removed request for
a team
May 2, 2024 21:22
blizzz
removed their request for review
May 3, 2024 08:01
artonge
reviewed
May 7, 2024
susnux
force-pushed
the
fix/ensure-blacklist-is-honored
branch
from
May 7, 2024 12:32
374aed6 to
60838bf
Compare
4 tasks
susnux
force-pushed
the
fix/ensure-blacklist-is-honored
branch
from
July 3, 2024 14:32
74de2ee to
841d19d
Compare
susnux
force-pushed
the
fix/ensure-blacklist-is-honored
branch
from
July 3, 2024 19:34
841d19d to
994dc7b
Compare
susnux
force-pushed
the
fix/ensure-blacklist-is-honored
branch
from
July 3, 2024 19:42
994dc7b to
1968b74
Compare
| } elseif (file_exists($src)) { | ||
| $validator = \OCP\Server::get(FilenameValidator::class); | ||
| if (!$validator->isForbidden(\basename($src))) { | ||
| copy($src, $dest); |
Check failure
Code scanning / Psalm
TaintedFile
susnux
force-pushed
the
fix/ensure-blacklist-is-honored
branch
from
July 3, 2024 20:05
1968b74 to
8d6cf37
Compare
susnux
marked this pull request as draft
July 3, 2024 20:07
susnux
force-pushed
the
fix/ensure-blacklist-is-honored
branch
3 times, most recently
from
July 3, 2024 21:41
e3dc322 to
5e160c0
Compare
…ame validation Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
…meValidator Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
…lidation Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
…izing Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
susnux
force-pushed
the
fix/ensure-blacklist-is-honored
branch
from
July 5, 2024 11:33
5e160c0 to
a5817ca
Compare
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some preparations and refactoring for #44963
Summary
\OCP\Util::getForbiddenFilenames())OC_Util::isValidFilenameas it was deprecated for a long time, not used anymore and not checking forbidden filenames\OCP\Files\FileInfo::BLACKLIST_FILES_REGEXas this was not used anywhere (only in the util function but that is also not used anywhere + in the files app, but never enforced on webdav).Todo⚠️ - Needs discussion
.fileinfofiles. So I dropped it, but should be instead enfore it?Checklist