Skip to content

Conversation

@sellisd
Copy link
Contributor

@sellisd sellisd commented Nov 21, 2024

No description provided.

throw IllegalArgumentException("Invalid destination: '$destination'. '..' is not allowed")
}
val workspace = getVerifiedWorkspace(organizationId, workspaceId, PERMISSION_WRITE)
if (file?.filename?.contains("..") == true || file?.filename?.contains("/") == true) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be useful to check for "" too ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The quote is a possible character for a filename (even though not very useful), and since it cannot be abused to write to a different location I think we should keep it

Copy link
Member

@jreynard-code jreynard-code left a comment

Choose a reason for hiding this comment

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

LGTM

@sellisd sellisd merged commit f0fc9b4 into main Nov 26, 2024
33 checks passed
@sellisd sellisd deleted the DSE/secure_file_uploads_PROD-2148 branch November 26, 2024 09:57
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.

4 participants