mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-07 23:13:11 -06:00
mediaapi/writers/fileutils: Make note of further file path validation todo
This commit is contained in:
parent
7af45e4664
commit
5dd90fbff3
|
|
@ -105,6 +105,11 @@ func getPathFromMediaMetadata(m *types.MediaMetadata, absBasePath types.Path) (s
|
||||||
fileName,
|
fileName,
|
||||||
))
|
))
|
||||||
|
|
||||||
|
// FIXME:
|
||||||
|
// - validate origin
|
||||||
|
// - sanitize mediaID (e.g. '/' characters and such)
|
||||||
|
// - validate length of origin and mediaID according to common filesystem limitations
|
||||||
|
|
||||||
// check if the absolute absBasePath is a prefix of the absolute filePath
|
// check if the absolute absBasePath is a prefix of the absolute filePath
|
||||||
// if so, no directory escape has occurred and the filePath is valid
|
// if so, no directory escape has occurred and the filePath is valid
|
||||||
// Note: absBasePath is already absolute
|
// Note: absBasePath is already absolute
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue