Skip to content

Commit

Permalink
Merge pull request #342 from Jueuunn7/main
Browse files Browse the repository at this point in the history
프로필 파일 업로드 취약점 패치
  • Loading branch information
KimTaeO authored Jul 3, 2024
2 parents 817b50e + cb4740e commit ffb204d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/kotlin/com/msg/gauth/global/thirdparty/aws/s3/S3Util.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ class S3Util(

val splitFile = image.originalFilename.toString().split(".")

if(splitFile.size < 2)
if(splitFile.size != 2)
throw FileExtensionInvalidException()

val extension = splitFile[1].lowercase()

val extension = splitFile.last().lowercase()
if(list.none { it == extension })
throw FileExtensionInvalidException()

Expand All @@ -49,4 +49,4 @@ class S3Util(

amazonS3.deleteObject(bucket, key)
}
}
}

0 comments on commit ffb204d

Please sign in to comment.