aboutsummaryrefslogtreecommitdiffstats
path: root/internal
diff options
context:
space:
mode:
authorgoogle-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>2026-02-18 05:03:24 +0000
committergoogle-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>2026-02-18 05:03:24 +0000
commitbac73556c98fb94d5c790c211b7e535f878ca85a (patch)
tree269cf49584a5f54daad083398a616aba724ed7b2 /internal
parent519e1baed7b85bba88ef5a111f02602b932cff8b (diff)
downloadneko-bac73556c98fb94d5c790c211b7e535f878ca85a.tar.gz
neko-bac73556c98fb94d5c790c211b7e535f878ca85a.tar.bz2
neko-bac73556c98fb94d5c790c211b7e535f878ca85a.zip
Fix unbounded memory usage in crawler (DoS)
Co-authored-by: adammathes <868470+adammathes@users.noreply.github.com>
Diffstat (limited to 'internal')
-rw-r--r--internal/crawler/security_test.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/crawler/security_test.go b/internal/crawler/security_test.go
index 198f7ee..f4d7b67 100644
--- a/internal/crawler/security_test.go
+++ b/internal/crawler/security_test.go
@@ -9,11 +9,12 @@ import (
"adammathes.com/neko/internal/safehttp"
)
-func init() {
+func TestGetFeedContentLimit(t *testing.T) {
+ // Enable local connections for this test
+ originalAllowLocal := safehttp.AllowLocal
safehttp.AllowLocal = true
-}
+ defer func() { safehttp.AllowLocal = originalAllowLocal }()
-func TestGetFeedContentLimit(t *testing.T) {
// 10MB limit expected
limit := 10 * 1024 * 1024
// 11MB payload