Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: labstack/echo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ec79b58
Choose a base ref
...
head repository: labstack/echo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c99c7cb
Choose a head ref
  • 20 commits
  • 50 files changed
  • 7 contributors

Commits on Jul 6, 2026

  1. Fix body limit middleware state contamination with limitedReader pre-…

    …check
    
    When a downstream middleware reads the request body (e.g., for audit logging)
    and restores it via io.NopCloser, the limitedReader's internal read counter
    could cause state contamination on rebinding attempts.
    
    - Added strict pre-read limit check in limitedReader.Read() to immediately
      return 413 when the limit has already been exceeded, preventing
      unnecessary reads that accumulate past the limit
    - Post-read check tightened to use > instead of >= for correct boundary
      handling
    - Added regression test proving body restoration with c.Bind() works
      correctly through the BodyLimit middleware chain
    Kunal Jaiswal authored and aldas committed Jul 6, 2026
    Configuration menu
    Copy the full SHA
    4f2f975 View commit details
    Browse the repository at this point in the history

Commits on Sep 27, 2026

  1. Merge commit from fork

    * fix: trust forwarded scheme headers only from trusted proxies (v4)
    
    Backport of the v5 fix for GHSA-2ffq-g2xg-c22p. Context.Scheme() now
    uses X-Forwarded-Proto, X-Forwarded-Protocol, X-Forwarded-Ssl and
    X-Url-Scheme only when the request comes directly from a loopback,
    link-local or private network address or a unix socket.
    Echo#SchemeExtractor selects the strategy: ExtractSchemeFromHeaders
    (default, accepts TrustOption), ExtractSchemeDirect, or
    LegacySchemeExtractor for the old behavior.
    
    The Secure middleware now uses Context.Scheme() for HSTS, and the Proxy
    middleware always sets X-Forwarded-Proto from Context.Scheme().
    
    * fix: validate JSONP callback and send nosniff header (v4)
    
    Backport of the v5 fix for GHSA-h9g5-28mm-hx3g. The callback must be
    empty, a JavaScript identifier or a dot-separated path of identifiers;
    otherwise nothing is written and a 400 Bad Request error wrapping
    ErrInvalidJSONPCallback is returned. JSONP responses also get the
    X-Content-Type-Options: nosniff header.
    
    Claude-Session: https://claude.ai/code/session_01QKDYQr53zNKkR7nif2CAAq
    
    * fix(method-override): do not override POST to safe methods (v4)
    
    Backport of the v5 fix for GHSA-r7w9-592q-9vg4. POST can no longer be
    overridden to GET, HEAD, OPTIONS, TRACE or CONNECT.
    
    Claude-Session: https://claude.ai/code/session_01QKDYQr53zNKkR7nif2CAAq
    
    * fix: percent-encode control characters in redirect paths (v4)
    
    Backport of the v5 fix for GHSA-v753-g4cw-jm48. sanitizeURI, used by
    the trailing slash middlewares and the static directory redirect, now
    percent-encodes C0 control characters and DEL before the double slash
    check, so a path such as /%09/evil.example/ can no longer redirect a
    browser to evil.example.
    
    Claude-Session: https://claude.ai/code/session_01QKDYQr53zNKkR7nif2CAAq
    
    * fix(static): resolve files from the routed path and reject dot segments (v4)
    
    Backport of the v5 fix for GHSA-375p-5qhx-8wq4 and GHSA-3pmx-cf9f-34xr.
    The Static middleware now resolves files from the same form of the path
    that the router matched, and both the Static middleware and
    StaticDirectoryHandler no longer serve paths with a ".", ".." or empty
    segment.
    
    Claude-Session: https://claude.ai/code/session_01QKDYQr53zNKkR7nif2CAAq
    
    * docs: changelog for security release and Static middleware guard note
    
    Claude-Session: https://claude.ai/code/session_01QKDYQr53zNKkR7nif2CAAq
    
    * fix: harden security fixes after review (v4)
    
    Backport of the v5 review follow-ups: X-Forwarded-Proto is used alone
    (last value) and returned in lowercase; the Proxy middleware removes
    X-Forwarded-Ssl, X-Forwarded-Protocol and X-Url-Scheme; static files
    check dot segments again after unescaping and keep the HTML5 index
    fallback; more tests; changelog behavior changes; bump Version to
    4.16.0.
    
    Claude-Session: https://claude.ai/code/session_01QKDYQr53zNKkR7nif2CAAq
    
    * docs: set v4.16.0 release date
    
    Claude-Session: https://claude.ai/code/session_01QKDYQr53zNKkR7nif2CAAq
    vishr authored Sep 27, 2026
    Configuration menu
    Copy the full SHA
    b838391 View commit details
    Browse the repository at this point in the history
  2. chore(deps): update golang.org/x/text to v0.40.0 (GO-2026-5970)

    govulncheck reports GO-2026-5970 (infinite loop on invalid input) in
    golang.org/x/text v0.38.0, reachable through StartH2CServer. master
    already uses v0.40.0.
    
    Claude-Session: https://claude.ai/code/session_01QKDYQr53zNKkR7nif2CAAq
    vishr committed Sep 27, 2026
    Configuration menu
    Copy the full SHA
    7a49ed2 View commit details
    Browse the repository at this point in the history
  3. Merge pull request #3120 from labstack/chore/v4-bump-x-text

    chore(deps): update golang.org/x/text to v0.40.0 (GO-2026-5970)
    vishr authored Sep 27, 2026
    Configuration menu
    Copy the full SHA
    e75c6c6 View commit details
    Browse the repository at this point in the history

Commits on Sep 28, 2026

  1. Configuration menu
    Copy the full SHA
    a7109fa View commit details
    Browse the repository at this point in the history

Commits on Sep 29, 2026

  1. Configuration menu
    Copy the full SHA
    5730445 View commit details
    Browse the repository at this point in the history
  2. static: harden dot-segment check for backslashes, test non-validating…

    … custom fs.FS (v4) (#3130)
    
    * static: reject backslash dot segments, test non-validating custom fs.FS
    
    * static: test backslash hardening on every OS, add default-config vectors, fix comments
    
    * static: keep static_windows.go reference (exists on v4)
    vishr authored Sep 29, 2026
    Configuration menu
    Copy the full SHA
    577ba39 View commit details
    Browse the repository at this point in the history
  3. fix(middleware): prevent BodyLimit bypass in v4 (#3131)

    Cap oversized request-body reads, preserve HTTP 413 through binding, and keep each request reader for its lifetime. Fixes #3071.
    vishr authored Sep 29, 2026
    Configuration menu
    Copy the full SHA
    5440f99 View commit details
    Browse the repository at this point in the history

Commits on Sep 30, 2026

  1. fix(router): handle escaped colons and inline verbs in v4 (#3132)

    * fix(router): keep escaped colon and parameter routes reachable in v4
    
    * fix(router): parse inline verbs consistently in v4
    
    * fix(router): backtrack inline verb splits in v4
    
    * perf(router): preserve v4 fast path without inline verbs
    
    * fix(router): retry inline verb splits on the param node in v4
    
    Backport of the v5 change. Replace the whole-search retry plan with a
    backtrack point on the param node: when a candidate split fails, the
    same param node is retried with the next literal-colon split and finally
    the whole path segment before routing backtracks to its parent. Static >
    param > any priority of ancestors, the leaf rule of later params, group
    middleware and catch-all routes are no longer affected by a failed split.
    
    An escaped colon after a parameter starts an inline verb only when the
    rest of that path segment is static (`/:name\:cancel`, optionally
    followed by `/...`). Split candidates are then scanned once per segment,
    so a request with many colons is routed in linear time. Other escaped
    colons after a parameter keep their older meaning as part of the
    parameter name.
    
    The duplicated fast-path Find and the router-level inline verb flag are
    removed. The param scan uses strings.IndexByte, which keeps router
    benchmarks within about 0.3% of v4 (geomean).
    
    * fix(router): retry inline verb splits after a wildcard fails
    
    A wildcard ends the route search, but a param value above it that ended
    at an inline verb split is now retried with the next split and the whole
    segment, so a verb route with a wildcard cannot shadow a generic route
    for other methods.
    
    The retry now runs only when routing backtracks from the inline verb
    child into its param node, instead of on every dead end.
    
    An escaped colon after a parameter keeps its older meaning (part of the
    parameter name) unless the first one in the segment starts an inline
    verb, so a later `\:` cannot turn such a legacy route into a verb route.
    Reverse writes placeholders for such names without the backslash, as
    before. Dead hasColonChild bookkeeping for split nodes is removed.
    
    * fix(router): keep backtracking below an inline verb split
    
    When a wildcard fails below a param value that ended at an inline verb
    split, keep backtracking one node at a time instead of jumping to that
    param node, so the other routes below the split are tried before the
    next split. Without a pending split a failed wildcard still ends the
    search as before, and the check does not change the routing state.
    
    Adds tests for nested splits, routes below a split and a RouteNotFound
    wildcard below a split.
    
    * fix(router): keep escaped colons after complex param names in v4
    
    An escaped colon after a param name that contains ':' or '*' keeps its
    older meaning as part of the name. The escaped colon check is shared in
    the route syntax scanner. Adds tests for RouteNotFound on the whole
    segment and Reverse placeholders.
    
    * fix(router): keep leaf params matching the rest of the path
    
    Registering an inline verb route under a param gave the param node a
    static child, so a sibling route ending in that param (`/files/:path`)
    stopped matching values across slashes. When the inline verb child is
    the node's only child, a param value without a split now takes the rest
    of the path, as a leaf param does.
    
    * test(router): cover leaf param fallbacks next to an inline verb
    
    Drop the param and any child checks that cannot fail for a param node, and pin 405, RouteNotFound and wildcard fallbacks for a param value that spans slashes next to an inline verb route.
    vishr authored Sep 30, 2026
    Configuration menu
    Copy the full SHA
    f085ffb View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2026

  1. fix(bind): honor OpenAPI date, date-time and date-time-local format t…

    …ags (v4) (#3156)
    
    Backport of #3145.
    
    Swag and OpenAPI put format names such as `format:"date-time"` on `time.Time` fields. Since v4.14.0 added `format` tag support, the binder has treated those names as Go time layouts, so valid input failed to bind.
    
    - `date-time` uses the same RFC3339 decoding as an untagged `time.Time`, restoring the pre-v4.14.0 behavior.
    - `date-time-local` accepts `2006-01-02T15:04:05` with optional fractional seconds, rejects time-zone suffixes, and assigns UTC.
    - `date` accepts `2006-01-02` and assigns UTC.
    - Other `format` values are still Go layouts. Slice fields, JSON/XML decoding, and custom unmarshalers are unchanged.
    
    Refs #3107
    vishr authored Oct 5, 2026
    Configuration menu
    Copy the full SHA
    320fe67 View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2026

  1. fix(router): grow param values for contexts created before a route wi…

    …th more params (v4) (#3158)
    
    Adding a route with path params after Echo has served requests could panic with "index out of range": pooled contexts keep the pvalues length they were created with, and Router.Find sets values by index.
    
    Find now grows the context's pvalues when it is about to set a param or any value past its length, keeps the values already set, and stores the new slice on the context. Static routes never reach these branches.
    
    Refs #1705
    vishr authored Oct 6, 2026
    Configuration menu
    Copy the full SHA
    be08005 View commit details
    Browse the repository at this point in the history

Commits on Oct 22, 2026

  1. Merge commit from fork

    * fix(middleware): bound v4 body dumps without truncating requests
    
    Default request and response capture to 5 MiB with configurable opt-outs. Replay captured request bytes before the remaining original stream and preserve read errors and Close ownership. Cover bounded captures, full payload delivery, and BodyLimit composition.
    
    Addresses GHSA-f48p-c9v4-h7xv. Request replay follows the v5 contribution in PR 3105.
    
    Co-authored-by: Jake Wang <[email protected]>
    
    * fix(middleware): limit v4 decompressed request sizes
    
    Apply a configurable 100 MiB decompression cap and return HTTP 413 for excess data. Accept exact-limit bodies, retain overflow errors on repeated reads, and clear compressed ContentLength metadata. Cover defaults, opt-outs, boundaries, and streaming compressed expansion.
    
    Addresses GHSA-h7wr-284f-5qvc. Boundary handling follows the v5 contribution in PR 3136.
    
    Co-authored-by: Shubham Padkonde <[email protected]>
    
    * fix(middleware): validate v4 proxy upgrades and close disconnected tunnels
    
    Backport the v5 standard reverse-proxy handling, WebSocket disconnect cleanup, ws/wss target normalization, and Forwarded-header removal. Cover rejected and accepted upgrades, both disconnect directions, and protocol mismatch.
    
    Addresses GHSA-cxf3-9h37-7rr8, GHSA-9969-6676-49h5, and hardens GHSA-6gpx-gjwr-mhp8.
    
    * fix(deps): update v4 HTTP/2 dependencies and require Go 1.26
    
    Upgrade golang.org/x/net to v0.60.0 and its required crypto, sys, and text versions to remediate reachable HTTP/2 advisories. Match the supported CI matrix to Go 1.26 and 1.27. Preserve the existing StartH2CServer API with narrow deprecation annotations.
    
    * test(middleware): verify v4 WebSocket transport and response hooks
    
    * fix(middleware): close v4 WebSocket backends that ignore client EOF
    
    Disable backend half-close after the response hook, matching frontend handling, for WebSocket upgrades. Add the review regression with an upstream that stays open after reading client EOF; the proxy must finish independently.
    
    * test(middleware): verify v4 decompression limits through JSON and XML binding
    
    Confirm that Bind preserves ErrStatusRequestEntityTooLarge and the default error handler returns HTTP 413 for both formats. This disproves the review claim that these paths turn the limit into HTTP 400.
    
    ---------
    
    Co-authored-by: Jake Wang <[email protected]>
    Co-authored-by: Shubham Padkonde <[email protected]>
    3 people authored Oct 22, 2026
    Configuration menu
    Copy the full SHA
    3fb0ba7 View commit details
    Browse the repository at this point in the history
  2. chore: prepare v4.16.1 security release (#3186)

    * chore: prepare v4.16.1 security release
    
    * docs: explain v4 security release requirements and defaults
    vishr authored Oct 22, 2026
    Configuration menu
    Copy the full SHA
    600b985 View commit details
    Browse the repository at this point in the history
  3. fix(middleware): reject CSRF TokenLookup that produces no extractors …

    …in v4 (#3149)
    
    A TokenLookup whose sources are all unknown (for example "nope:nope")
    parsed without error but yielded zero extractors. With nothing to
    check, unsafe requests were let through without any token validation.
    Fail middleware creation instead, so the misconfiguration surfaces at
    startup.
    
    Backport of #3067.
    orinnz authored Oct 22, 2026
    Configuration menu
    Copy the full SHA
    ea608ae View commit details
    Browse the repository at this point in the history
  4. fix(middleware): check Basic auth scheme boundary in v4 (#3188)

    Backport #3138. Reject malformed schemes such as BasicX before decoding
    credentials or invoking the validator. v4 reads only its first Authorization
    header and has no AllowedCheckLimit, so its regression covers that API.
    
    Co-authored-by: Shubham Padkonde <[email protected]>
    vishr and Shubham-Padkonde authored Oct 22, 2026
    Configuration menu
    Copy the full SHA
    6d1bb2e View commit details
    Browse the repository at this point in the history
  5. fix(middleware): reject empty CSRF tokens in v4 (#3189)

    Backport #3135 as defense in depth. Reject empty cookie or client tokens
    before constant-time comparison, retaining normal valid-token behavior.
    
    Co-authored-by: Harry Tran <[email protected]>
    vishr and hoangtaiki authored Oct 22, 2026
    Configuration menu
    Copy the full SHA
    3b16891 View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2026

  1. Configuration menu
    Copy the full SHA
    679c415 View commit details
    Browse the repository at this point in the history

Commits on Oct 29, 2026

  1. docs: state v4 bug-fix and security-fix dates (#3194)

    v4 receives bug fixes until 2026-12-31 and free security fixes until
    2027-12-31 on its latest release; the full policy lives in SECURITY.md
    on master.
    vishr authored Oct 29, 2026
    Configuration menu
    Copy the full SHA
    fa780cd View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2026

  1. fix: secure v4 client IP defaults for proxying and rate limiting (#3197)

    * fix: derive v4 client IP from the connection peer by default
    
    Ignore untrusted forwarding headers when IPExtractor is unset and always replace upstream X-Real-IP from Context.RealIP. Preserve explicit extractors and document migration for applications behind proxies. Addresses CVE-2026-118651 and CVE-2026-118653.
    
    * fix: preserve derived proxy identity after hop header stripping
    
    * docs: describe the secure RealIP default on the public interface
    vishr authored Oct 30, 2026
    Configuration menu
    Copy the full SHA
    ebbb855 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c99c7cb View commit details
    Browse the repository at this point in the history
Loading