Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CWE-434: Unrestricted Upload of File with Dangerous Type. Polyglot fi… #1469

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

src/Naming/OrignameNamer.php Outdated Show resolved Hide resolved
@jphetphoumy jphetphoumy marked this pull request as draft September 30, 2024 19:10
$basename = \substr(\pathinfo($originalName, \PATHINFO_FILENAME), 0, 240);
$basename = \strtolower($this->transliterator->transliterate($basename));
$slug = \sprintf('%s.%s', $basename, $extension);
$slug = $extension ? \sprintf('%s.%s', $basename, $extension) : $basename;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implicit casting here too (and in other similar statements)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is implicit casting in Base64Namer from the master branch, do you want me to change it here too ?

if ($extension = $this->getExtension($file)) {
$name = "$name.$extension";
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoiding adding new ones is enough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants