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: go-openapi/spec
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.22.6
Choose a base ref
...
head repository: go-openapi/spec
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.22.7
Choose a head ref
  • 17 commits
  • 23 files changed
  • 4 contributors

Commits on Jun 19, 2026

  1. build(deps): bump go-openapi/ci-workflows/.github/workflows/monitor-b…

    …ot-pr.yml
    
    Bumps the development-dependencies group with 1 update: [go-openapi/ci-workflows/.github/workflows/monitor-bot-pr.yml](https://github.com/go-openapi/ci-workflows).
    
    
    Updates `go-openapi/ci-workflows/.github/workflows/monitor-bot-pr.yml` from 93b16765c4045dbd4dac2372803294298aa7592a to 2e57e83146e049b5dfb8116ba16a09b2da27b3c5
    - [Release notes](https://github.com/go-openapi/ci-workflows/releases)
    - [Commits](go-openapi/ci-workflows@93b1676...2e57e83)
    
    ---
    updated-dependencies:
    - dependency-name: go-openapi/ci-workflows/.github/workflows/monitor-bot-pr.yml
      dependency-version: 2e57e83146e049b5dfb8116ba16a09b2da27b3c5
      dependency-type: direct:production
      dependency-group: development-dependencies
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored and github-actions[bot] committed Jun 19, 2026
    Configuration menu
    Copy the full SHA
    dc55c96 View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2026

  1. doc: updated contributors file

    Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    bot-go-openapi[bot] authored and github-actions[bot] committed Jun 20, 2026
    Configuration menu
    Copy the full SHA
    eb04d47 View commit details
    Browse the repository at this point in the history

Commits on Jun 21, 2026

  1. chore(ci): run contributors workflow monthly instead of weekly (#281)

    The all-time contributors workflow no longer needs a weekly cadence:
    nowadays it mostly bumps maintainer activity. Run it on the 1st of
    each month at 04:49 UTC ('49 4 1 * *') instead of every Saturday.
    
    Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
    Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    fredbi and claude authored Jun 21, 2026
    Configuration menu
    Copy the full SHA
    1754e05 View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2026

  1. ci: post README announcements to discord + bump ci-workflows to v0.4.0 (

    #282)
    
    Add the webhook-announcements workflow (mirrors go-openapi/testify): pushes
    to master that change README.md are scanned for new "## Announcements"
    entries and posted to the discord channel.
    Also bump all ci-workflows shared-workflow pins to v0.4.0
    (af4c93f45481ea7d24ac2a9858272cc03daf424e).
    
    Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
    Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    fredbi and claude authored Jun 22, 2026
    Configuration menu
    Copy the full SHA
    da6a6cf View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2026

  1. build(deps): bump the go-openapi-dependencies group with 2 updates

    Bumps the go-openapi-dependencies group with 2 updates: [github.com/go-openapi/testify/enable/yaml/v2](https://github.com/go-openapi/testify) and [github.com/go-openapi/testify/v2](https://github.com/go-openapi/testify).
    
    
    Updates `github.com/go-openapi/testify/enable/yaml/v2` from 2.5.1 to 2.6.0
    - [Release notes](https://github.com/go-openapi/testify/releases)
    - [Commits](go-openapi/testify@v2.5.1...v2.6.0)
    
    Updates `github.com/go-openapi/testify/v2` from 2.5.1 to 2.6.0
    - [Release notes](https://github.com/go-openapi/testify/releases)
    - [Commits](go-openapi/testify@v2.5.1...v2.6.0)
    
    ---
    updated-dependencies:
    - dependency-name: github.com/go-openapi/testify/enable/yaml/v2
      dependency-version: 2.6.0
      dependency-type: direct:production
      update-type: version-update:semver-minor
      dependency-group: go-openapi-dependencies
    - dependency-name: github.com/go-openapi/testify/v2
      dependency-version: 2.6.0
      dependency-type: direct:production
      update-type: version-update:semver-minor
      dependency-group: go-openapi-dependencies
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored and github-actions[bot] committed Jun 26, 2026
    Configuration menu
    Copy the full SHA
    bac1bee View commit details
    Browse the repository at this point in the history

Commits on Jul 1, 2026

  1. doc: updated contributors file

    Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    bot-go-openapi[bot] authored and github-actions[bot] committed Jul 1, 2026
    Configuration menu
    Copy the full SHA
    8e7a0e6 View commit details
    Browse the repository at this point in the history

Commits on Jul 3, 2026

  1. build(deps): bump the go-openapi-dependencies group with 6 updates

    Bumps the go-openapi-dependencies group with 6 updates:
    
    | Package | From | To |
    | --- | --- | --- |
    | [github.com/go-openapi/jsonpointer](https://github.com/go-openapi/jsonpointer) | `0.23.1` | `0.24.0` |
    | [github.com/go-openapi/swag/conv](https://github.com/go-openapi/swag) | `0.26.1` | `0.27.0` |
    | [github.com/go-openapi/swag/jsonname](https://github.com/go-openapi/swag) | `0.26.1` | `0.27.0` |
    | [github.com/go-openapi/swag/jsonutils](https://github.com/go-openapi/swag) | `0.26.1` | `0.27.0` |
    | [github.com/go-openapi/swag/loading](https://github.com/go-openapi/swag) | `0.26.1` | `0.27.0` |
    | [github.com/go-openapi/swag/stringutils](https://github.com/go-openapi/swag) | `0.26.1` | `0.27.0` |
    
    
    Updates `github.com/go-openapi/jsonpointer` from 0.23.1 to 0.24.0
    - [Release notes](https://github.com/go-openapi/jsonpointer/releases)
    - [Commits](go-openapi/jsonpointer@v0.23.1...v0.24.0)
    
    Updates `github.com/go-openapi/swag/conv` from 0.26.1 to 0.27.0
    - [Release notes](https://github.com/go-openapi/swag/releases)
    - [Commits](go-openapi/swag@v0.26.1...v0.27.0)
    
    Updates `github.com/go-openapi/swag/jsonname` from 0.26.1 to 0.27.0
    - [Release notes](https://github.com/go-openapi/swag/releases)
    - [Commits](go-openapi/swag@v0.26.1...v0.27.0)
    
    Updates `github.com/go-openapi/swag/jsonutils` from 0.26.1 to 0.27.0
    - [Release notes](https://github.com/go-openapi/swag/releases)
    - [Commits](go-openapi/swag@v0.26.1...v0.27.0)
    
    Updates `github.com/go-openapi/swag/loading` from 0.26.1 to 0.27.0
    - [Release notes](https://github.com/go-openapi/swag/releases)
    - [Commits](go-openapi/swag@v0.26.1...v0.27.0)
    
    Updates `github.com/go-openapi/swag/stringutils` from 0.26.1 to 0.27.0
    - [Release notes](https://github.com/go-openapi/swag/releases)
    - [Commits](go-openapi/swag@v0.26.1...v0.27.0)
    
    ---
    updated-dependencies:
    - dependency-name: github.com/go-openapi/jsonpointer
      dependency-version: 0.24.0
      dependency-type: direct:production
      update-type: version-update:semver-minor
      dependency-group: go-openapi-dependencies
    - dependency-name: github.com/go-openapi/swag/conv
      dependency-version: 0.27.0
      dependency-type: direct:production
      update-type: version-update:semver-minor
      dependency-group: go-openapi-dependencies
    - dependency-name: github.com/go-openapi/swag/jsonname
      dependency-version: 0.27.0
      dependency-type: direct:production
      update-type: version-update:semver-minor
      dependency-group: go-openapi-dependencies
    - dependency-name: github.com/go-openapi/swag/jsonutils
      dependency-version: 0.27.0
      dependency-type: direct:production
      update-type: version-update:semver-minor
      dependency-group: go-openapi-dependencies
    - dependency-name: github.com/go-openapi/swag/loading
      dependency-version: 0.27.0
      dependency-type: direct:production
      update-type: version-update:semver-minor
      dependency-group: go-openapi-dependencies
    - dependency-name: github.com/go-openapi/swag/stringutils
      dependency-version: 0.27.0
      dependency-type: direct:production
      update-type: version-update:semver-minor
      dependency-group: go-openapi-dependencies
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored and github-actions[bot] committed Jul 3, 2026
    Configuration menu
    Copy the full SHA
    9b21ccd View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2026

  1. build(deps): bump the go-openapi-dependencies group with 2 updates (#286

    )
    
    Bumps the go-openapi-dependencies group with 2 updates: [github.com/go-openapi/jsonpointer](https://github.com/go-openapi/jsonpointer) and [github.com/go-openapi/jsonreference](https://github.com/go-openapi/jsonreference).
    
    
    Updates `github.com/go-openapi/jsonpointer` from 0.24.0 to 1.0.0
    - [Release notes](https://github.com/go-openapi/jsonpointer/releases)
    - [Commits](go-openapi/jsonpointer@v0.24.0...v1.0.0)
    
    Updates `github.com/go-openapi/jsonreference` from 0.21.6 to 1.0.0
    - [Release notes](https://github.com/go-openapi/jsonreference/releases)
    - [Commits](go-openapi/jsonreference@v0.21.6...v1.0.0)
    
    ---
    updated-dependencies:
    - dependency-name: github.com/go-openapi/jsonpointer
      dependency-version: 1.0.0
      dependency-type: direct:production
      update-type: version-update:semver-major
      dependency-group: go-openapi-dependencies
    - dependency-name: github.com/go-openapi/jsonreference
      dependency-version: 1.0.0
      dependency-type: direct:production
      update-type: version-update:semver-major
      dependency-group: go-openapi-dependencies
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jul 12, 2026
    Configuration menu
    Copy the full SHA
    1688f14 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2026

  1. fix(expander): cap $ref expansion node count to prevent amplification…

    … DoS
    
    ExpandSpec/ExpandSchema* inline every $ref with no memoization and no global
    budget. A self-contained spec where each of N definitions references the next
    one twice (via allOf/anyOf/oneOf/properties/items) drives 2^N schema expansions
    from O(N) bytes of input. A ~1.5 KB document expands into tens of GB of heap and
    >30 s of CPU, letting an unauthenticated caller exhaust resources in any service
    that expands untrusted specs. All refs can be fragment-only, so a restrictive
    PathLoader is not a mitigation.
    
    The expanded output itself is exponential (expansion inlines by value), so a
    memoization cache would bound CPU but not memory. The only guard that bounds
    memory is refusing to build the tree past a budget.
    
    Add ExpandOptions.MaxExpansionNodes, a per-call cap on the number of expanded
    schema nodes, enforced by a counter in the shared resolverContext incremented at
    the top of expandSchema:
    
      0  (zero value): DefaultMaxExpansionNodes (500,000) -- every caller protected
      <0: unbounded (trusted specs only)
      >0: explicit cap
    
    500,000 leaves ~10x headroom over the largest real spec we test (the full
    Kubernetes API expands to ~47,000 nodes) while stopping the attack well before it
    hurts. The metric is nodes, not $ref resolutions: measurement showed resolution
    counts do not grow with the attack (document-level caching collapses them), so a
    resolution cap would miss the blow-up entirely.
    
    Exceeding the budget returns ErrExpandTooManyNodes. This is a resource-exhaustion
    safeguard, so it is terminal even under ContinueOnError, rather than leaving the
    caller with a silently truncated spec.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
    fredbi and claude committed Jul 20, 2026
    Configuration menu
    Copy the full SHA
    d76a1a4 View commit details
    Browse the repository at this point in the history
  2. chore: upgrade dependencies ; fix deprecated jsonname

    Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
    fredbi committed Jul 20, 2026
    Configuration menu
    Copy the full SHA
    5ae1e0d View commit details
    Browse the repository at this point in the history
  3. feat(expander): accept an option-aware document loader

    Add ExpandOptions.PathLoaderWithOptions, a document loader matching the
    func(string, ...loading.Option) (json.RawMessage, error) signature now used by
    the go-openapi/swag/loading and go-openapi/loads loaders. When set, it takes
    precedence over PathLoader, which in turn precedes the package-level default.
    
    This lets a caller inject an options-aware loader -- for example one confined
    to a directory with loading.WithRoot to safely resolve $ref targets from an
    untrusted spec -- directly, without wrapping it in a func(string) adapter
    closure. The injected loader carries its own loading options; the expander
    invokes it without adding any, keeping the plumbing free of forwarding logic.
    
    The change is additive: existing callers using PathLoader (or the default) are
    unaffected.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
    fredbi and claude committed Jul 20, 2026
    Configuration menu
    Copy the full SHA
    64655f3 View commit details
    Browse the repository at this point in the history
  4. fix(ref): stop performing a network request in IsValidURI

    IsValidURI resolved an absolute-URL $ref by issuing http.Get(v) on
    http.DefaultClient, which has no timeout and no cancellation. On an
    attacker-controlled URL whose server accepts the connection but never responds,
    the call blocks indefinitely, leaking goroutines, sockets, and file descriptors.
    Because go-openapi/validate calls IsValidURI on every $ref of a spec (in
    validateReferencesValid), an untrusted document full of stalling full-URL refs
    can exhaust resources during validation (CWE-400/CWE-770). The bare GET to an
    arbitrary, caller-supplied URL is also an SSRF vector against internal
    addresses.
    
    A method named IsValidURI should validate the reference, not probe remote
    reachability over the network: that made validation depend on network
    availability and non-deterministic. Resolving and fetching remote references is
    the expander's job, through its configurable (and now confinable) document
    loader.
    
    Treat a well-formed absolute URL as a valid URI without any network request.
    Local file references are still checked on disk. No spec or validate test
    depended on the probe (validate's fixtures use fragment-only refs).
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
    fredbi and claude committed Jul 20, 2026
    Configuration menu
    Copy the full SHA
    4e073e1 View commit details
    Browse the repository at this point in the history
  5. docs(security): warn that the default $ref loader is not sandboxed

    Expanding or resolving a specification loads referenced documents through a
    pluggable loader that, by default, is unconfined. A "$ref" in an untrusted spec
    can therefore read local files ("file:///etc/passwd", "../../secret.json" —
    arbitrary file read / path traversal) or reach internal addresses via a remote
    "$ref" (SSRF). This is inherent to the default configuration; it is not fixed by
    a code change but by using a confined loader.
    
    The mitigation already exists: inject an option-aware loader via
    ExpandOptions.PathLoaderWithOptions built with go-openapi/swag/loading options
    (loading.WithRoot to confine local reads, loading.WithHTTPClient to restrict
    remote fetches), or — recommended — use the restricted loaders from
    go-openapi/loads (SpecRestricted / SetRestrictedLoaders), which confine local
    reads and reject loopback/private/link-local remote addresses, and whose
    confinement applies to every "$ref" resolved during expansion.
    
    Document this in a package-level "Security" section and add pointers to it from
    ExpandSpec, ExpandSchemaWithBasePath and ExpandOptions. Also cross-reference
    ExpandOptions.MaxExpansionNodes for the related $ref amplification vector.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
    fredbi and claude committed Jul 20, 2026
    Configuration menu
    Copy the full SHA
    7229152 View commit details
    Browse the repository at this point in the history
  6. build(deps): bump swag/loading to v0.27.2 for confined $ref loading

    swag/loading v0.27.2 makes loading.WithRoot resolve absolute in-root paths
    (rebasing them onto the root) instead of rejecting every absolute path. Because
    spec normalizes every $ref to an absolute path against the spec's base, this is
    what makes a WithRoot-confined loader usable to safely expand an untrusted spec:
    legitimate in-root references resolve, while file:// and ../ references that
    escape the root are rejected.
    
    Add a consumer-side test that expands an untrusted spec through a
    PathLoaderWithOptions loader bound to loading.WithRoot, with an absolute
    RelativeBase: it asserts the in-root reference expands, the escaping references
    stay unexpanded, and no byte of the out-of-root file leaks into the result.
    
    go mod tidy also drops the now-unused swag/jsonname dependency.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
    fredbi and claude committed Jul 20, 2026
    Configuration menu
    Copy the full SHA
    75e4859 View commit details
    Browse the repository at this point in the history
  7. test(expander): validate the SSRF posture of an injected loader

    Expanding a spec with the default loader fetches any remote "$ref" through
    http.DefaultClient with no address filtering, so a "$ref" to a cloud metadata
    endpoint (e.g. AWS IMDS at 169.254.169.254), a private address, or localhost is
    an SSRF vector. This is documented in the package "Security" section; the
    mitigation is to inject an option-aware loader bound to a restricted HTTP
    client via ExpandOptions.PathLoaderWithOptions (or use the restricted loaders
    from go-openapi/loads).
    
    Add a regression test proving that posture end to end: a loader bound to a
    client whose DialContext refuses loopback/private/link-local/unspecified
    addresses causes ExpandSpec to refuse the IMDS reference at dial time, before
    any connection is made. The loader selection is shared by every expansion and
    resolution entry point, so this covers ExpandSpec, ExpandSchemaWithBasePath,
    ExpandResponse, ExpandParameter and the Resolve* functions.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
    fredbi and claude committed Jul 20, 2026
    Configuration menu
    Copy the full SHA
    fe9f8bd View commit details
    Browse the repository at this point in the history
  8. build(deps): bump swag modules to v0.27.3

    Supersedes the v0.27.2 bump. swag/loading v0.27.3 fixes WithRoot on Windows:
    spec normalizes references to a file-URL path form ("/C:/dir/file"), which
    v0.27.2 did not recognize as absolute, so os.Root rejected legitimate in-root
    targets and TestExpand_ConfinedLoader failed on Windows CI. v0.27.3 normalizes
    that form before confinement, so a WithRoot-confined loader resolves in-root
    references on Windows too, while still rejecting file:// and ../ escapes.
    
    All go-openapi/swag submodules are moved to v0.27.3 together (stringutils, which
    had no v0.27.2 tag, is included). No spec code change is required.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
    fredbi and claude committed Jul 20, 2026
    Configuration menu
    Copy the full SHA
    497d583 View commit details
    Browse the repository at this point in the history
  9. Merge pull request #290 from fredbi/fix/vuln-reports

    Fix/vuln reports
    fredbi authored Jul 20, 2026
    Configuration menu
    Copy the full SHA
    5173965 View commit details
    Browse the repository at this point in the history
Loading
⌂ 换网址