- "91f630e034cbe0f5f21b3b450ce222fa0f7ab8c1": "fix(static): disable static path unescaping by default to prevent ACL bypass\n\nFixes GHSA-3pmx-cf9f-34xr, a bypass of the GHSA-vfp3-v2gw-7wfq fix.\n\nThe router matches the raw, still-encoded request path, so encoded\nseparators and dot segments in a static wildcard are not seen as\ntraversal during routing. Unescaping them in the static file resolver\nafterwards let an attacker reach a file across a route-level middleware\nguard the encoded path never matched:\n\n - /public/%2E%2E/admin/secret.txt resolved to admin/secret.txt\n (high severity, default router)\n - /public%2F..%2Fadmin%2Fsecret.txt under UseEscapedPathForMatching=true,\n where the router decodes the path itself before the handler sees it\n\nRather than keep extending an encoding denylist, address the root cause:\nmake static path unescaping opt-in.\n\n - echo: Config.EnablePathUnescapingStaticFiles (default false) controls\n unescaping for Echo.Static/StaticFS and Group.Static/StaticFS.\n - middleware: StaticConfig.EnablePathUnescaping replaces the now\n deprecated DisablePathUnescaping (default is the safe, no-unescape mode).\n\nWith unescaping off, %2F/%5C/%2E%2E stay literal and never become\nseparators or traversal. As defense in depth, and to also close the\nUseEscapedPathForMatching variant (where the router, not the handler,\ndoes the decoding), reject any \"..\" path segment in the resolved\nwildcard via pathutil.HasDotDotSegment, mirroring the fs.ValidPath\n\"no .. element\" invariant. The existing encoded-separator guard remains\nas a backstop on the opt-in unescaping path.\n\nBREAKING CHANGE: static files whose names contain URL-encoded characters\n(e.g. \"hello world.txt\" via /hello%20world.txt) are no longer served by\ndefault; set EnablePathUnescapingStaticFiles / EnablePathUnescaping to\nopt back in.\n\nCo-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>",
0 commit comments