aboutsummaryrefslogtreecommitdiffstats
path: root/web/web.go
diff options
context:
space:
mode:
authorAdam Mathes <adam@adammathes.com>2026-02-14 09:17:56 -0800
committerAdam Mathes <adam@adammathes.com>2026-02-14 09:17:56 -0800
commitcac85dc06b519d9bd6db4d017d501dffbbd8bac4 (patch)
treedc8024e501c0fbda6b9d28622ff2553475044487 /web/web.go
parentca1418fc0135d52a009ab218d6e24187fb355a3c (diff)
downloadneko-cac85dc06b519d9bd6db4d017d501dffbbd8bac4.tar.gz
neko-cac85dc06b519d9bd6db4d017d501dffbbd8bac4.tar.bz2
neko-cac85dc06b519d9bd6db4d017d501dffbbd8bac4.zip
security: mitigate SSRF in image proxy and feed fetcher (fixing NK-0ca7nq)
Diffstat (limited to 'web/web.go')
-rw-r--r--web/web.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/web/web.go b/web/web.go
index 3c53edf..4868577 100644
--- a/web/web.go
+++ b/web/web.go
@@ -20,6 +20,7 @@ import (
"adammathes.com/neko/api"
"adammathes.com/neko/config"
+ "adammathes.com/neko/internal/safehttp"
"golang.org/x/crypto/bcrypt"
)
@@ -74,9 +75,7 @@ func imageProxyHandler(w http.ResponseWriter, r *http.Request) {
}
// grab the img
- c := &http.Client{
- Timeout: 5 * time.Second,
- }
+ c := safehttp.NewSafeClient(5 * time.Second)
request, err := http.NewRequest("GET", string(decodedURL), nil)
if err != nil {