mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-23 08:36:41 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a7bf9ca491 | |||
| ba8a1b7caf | |||
| 40afc13d7f | |||
| 122e4bc072 |
@@ -134,7 +134,10 @@ bots:
|
|||||||
adjust: -5
|
adjust: -5
|
||||||
|
|
||||||
- name: should-have-accept
|
- name: should-have-accept
|
||||||
expression: '!("Accept" in headers)'
|
expression:
|
||||||
|
all:
|
||||||
|
- userAgent.contains("Mozilla")
|
||||||
|
- '!("Accept" in headers)'
|
||||||
action: WEIGH
|
action: WEIGH
|
||||||
weight:
|
weight:
|
||||||
adjust: 5
|
adjust: 5
|
||||||
|
|||||||
@@ -118,7 +118,10 @@
|
|||||||
adjust: -5
|
adjust: -5
|
||||||
|
|
||||||
- name: should-have-accept
|
- name: should-have-accept
|
||||||
expression: '!("Accept" in headers)'
|
expression:
|
||||||
|
all:
|
||||||
|
- userAgent.contains("Mozilla")
|
||||||
|
- '!("Accept" in headers)'
|
||||||
action: WEIGH
|
action: WEIGH
|
||||||
weight:
|
weight:
|
||||||
adjust: 5
|
adjust: 5
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ 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,6 +100,9 @@ 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,6 +7,7 @@ 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"
|
||||||
@@ -152,9 +153,7 @@ func (i *Impl) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
realIP, _ := internal.RealIP(r)
|
realIP, _ := internal.RealIP(r)
|
||||||
if !realIP.IsValid() {
|
if !realIP.IsValid() {
|
||||||
lg.Error("the real IP is somehow invalid, bad middleware stack?")
|
realIP = netip.MustParseAddr(r.Header.Get("X-Real-Ip"))
|
||||||
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