Security
- Proxy middleware: after routing, a
.or..path segment (also encoded as%2e) was resolved byRewrite/RegexRewriteor by the upstream into a path the router never matched, bypassing route and group middleware such as authentication. After routing, Proxy now returns400 Bad Requestfor such paths, and rewrite targets in Proxy and the Rewrite middleware are applied literally instead of being resolved; a target with a dot segment or a leading//is rejected. Fixes GHSA-w5j2-g3fc-pwr6. Reported by AndyAnh174. - Static files:
Static,StaticFS,Group.StaticandGroup.StaticFSwith a prefix without a trailing slash registeredprefix*, so/assetsadmin/private.txtwas served from<root>/admin/private.txtfore.Static("/assets", root), bypassing a guard on/assets/admin. They now registerprefix/*, plusprefixfor the redirect toprefix/. Fixes GHSA-76qj-xf66-r429. Reported by AndyAnh174. - Static middleware on a group: documented that
middleware.Staticattached withGroup#Useis not protected by guards on routes inside the group or on nested groups, and thatGroup#Staticshould be used for files behind such guards. See GHSA-5hp7-4fcm-57f9. Reported by AndyAnh174.
Behavior changes
- After routing, Proxy rejects paths with
./..segments, and a Rewrite middleware attached after routing applies its targets literally: relative targets and absolute URLs are rejected.Echo#Preis unchanged. StaticandStaticFSreturn the route forprefix/*instead ofprefix*, and file names that only start with the prefix are no longer served.
No public API, dependency or minimum Go-version changes; Go 1.26 or later remains required.