You've already forked imgproxy
mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-12-07 23:32:55 +02:00
Prohibit connecting to loopback, link-local multicast, and link-local unicast IP addresses by default
This commit is contained in:
@@ -233,13 +233,8 @@ func handleProcessing(reqID string, rw http.ResponseWriter, r *http.Request) {
|
||||
po, imageURL, err := options.ParsePath(path, r.Header)
|
||||
checkErr(ctx, "path_parsing", err)
|
||||
|
||||
if !security.VerifySourceURL(imageURL) {
|
||||
sendErrAndPanic(ctx, "security", ierrors.New(
|
||||
404,
|
||||
fmt.Sprintf("Source URL is not allowed: %s", imageURL),
|
||||
"Invalid source",
|
||||
))
|
||||
}
|
||||
err = security.VerifySourceURL(imageURL)
|
||||
checkErr(ctx, "security", err)
|
||||
|
||||
if po.Raw {
|
||||
streamOriginImage(ctx, reqID, r, rw, po, imageURL)
|
||||
|
||||
Reference in New Issue
Block a user