mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-24 00:56:39 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 15b0927c46 | |||
| 5e69031c10 | |||
| 9ccd5db528 | |||
| 82fca3e714 | |||
| 83c8c3606a | |||
| 958daba4a1 | |||
| e0f4468b03 | |||
| ade8505b26 |
@@ -134,10 +134,7 @@ bots:
|
|||||||
adjust: -5
|
adjust: -5
|
||||||
|
|
||||||
- name: should-have-accept
|
- name: should-have-accept
|
||||||
expression:
|
expression: '!("Accept" in headers)'
|
||||||
all:
|
|
||||||
- userAgent.contains("Mozilla")
|
|
||||||
- '!("Accept" in headers)'
|
|
||||||
action: WEIGH
|
action: WEIGH
|
||||||
weight:
|
weight:
|
||||||
adjust: 5
|
adjust: 5
|
||||||
|
|||||||
@@ -118,10 +118,7 @@
|
|||||||
adjust: -5
|
adjust: -5
|
||||||
|
|
||||||
- name: should-have-accept
|
- name: should-have-accept
|
||||||
expression:
|
expression: '!("Accept" in headers)'
|
||||||
all:
|
|
||||||
- userAgent.contains("Mozilla")
|
|
||||||
- '!("Accept" in headers)'
|
|
||||||
action: WEIGH
|
action: WEIGH
|
||||||
weight:
|
weight:
|
||||||
adjust: 5
|
adjust: 5
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ Anubis is back and better than ever! Lots of minor fixes with some big ones inte
|
|||||||
- Add support to simple Valkey/Redis cluster mode
|
- Add support to simple Valkey/Redis cluster mode
|
||||||
- Open Graph passthrough now reuses the configured target Host/SNI/TLS settings, so metadata fetches succeed when the upstream certificate differs from the public domain. ([1283](https://github.com/TecharoHQ/anubis/pull/1283))
|
- Open Graph passthrough now reuses the configured target Host/SNI/TLS settings, so metadata fetches succeed when the upstream certificate differs from the public domain. ([1283](https://github.com/TecharoHQ/anubis/pull/1283))
|
||||||
- Stabilize the CVE-2025-24369 regression test by always submitting an invalid proof instead of relying on random POW failures.
|
- Stabilize the CVE-2025-24369 regression test by always submitting an invalid proof instead of relying on random POW failures.
|
||||||
- Refine the check that ensures the presence of the Accept header to avoid breaking docker clients.
|
|
||||||
|
|
||||||
### Dataset poisoning
|
### Dataset poisoning
|
||||||
|
|
||||||
|
|||||||
@@ -100,9 +100,6 @@ func XForwardedForToXRealIP(next http.Handler) http.Handler {
|
|||||||
ip := xff.Parse(xffHeader)
|
ip := xff.Parse(xffHeader)
|
||||||
slog.Debug("setting X-Real-Ip from X-Forwarded-For", "to", ip, "x-forwarded-for", xffHeader)
|
slog.Debug("setting X-Real-Ip from X-Forwarded-For", "to", ip, "x-forwarded-for", xffHeader)
|
||||||
r.Header.Set("X-Real-Ip", ip)
|
r.Header.Set("X-Real-Ip", ip)
|
||||||
if addr, err := netip.ParseAddr(ip); err == nil {
|
|
||||||
r = r.WithContext(context.WithValue(r.Context(), realIPKey{}, addr))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
next.ServeHTTP(w, r)
|
next.ServeHTTP(w, r)
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import (
|
|||||||
"log/slog"
|
"log/slog"
|
||||||
"math/rand/v2"
|
"math/rand/v2"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/netip"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/TecharoHQ/anubis/internal"
|
"github.com/TecharoHQ/anubis/internal"
|
||||||
@@ -153,7 +152,9 @@ func (i *Impl) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
realIP, _ := internal.RealIP(r)
|
realIP, _ := internal.RealIP(r)
|
||||||
if !realIP.IsValid() {
|
if !realIP.IsValid() {
|
||||||
realIP = netip.MustParseAddr(r.Header.Get("X-Real-Ip"))
|
lg.Error("the real IP is somehow invalid, bad middleware stack?")
|
||||||
|
http.Error(w, "The cake is a lie", http.StatusTeapot)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
network, ok := internal.ClampIP(realIP)
|
network, ok := internal.ClampIP(realIP)
|
||||||
|
|||||||
Reference in New Issue
Block a user