Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/vulndb: potential Go vuln in github.com/ory/oathkeeper: GHSA-qvp4-rpmr-xwrr #406

Closed
GoVulnBot opened this issue Mar 24, 2022 · 3 comments
Labels
excluded: EFFECTIVELY_PRIVATE This vulnerability exists in a package can be imported, but isn't meant to be outside that module.

Comments

@GoVulnBot
Copy link

In GitHub Security Advisory GHSA-qvp4-rpmr-xwrr, there is a vulnerability in the following Go packages or modules:

Unit Fixed Vulnerable Ranges
github.com/ory/oathkeeper 0.38.12-beta.1 >= 0.38.0-beta.2, <= 0.38.11-beta.1

See doc/triage.md for instructions on how to triage this report.

package: github.com/ory/oathkeeper
versions:
  - introduced: TODO (earliest fixed "0.38.12-beta.1", vuln range ">= 0.38.0-beta.2,
        <= 0.38.11-beta.1")
description: |-
    ### Impact

    When you make a request to an endpoint that requires the scope `foo` using an access token granted with that `foo` scope, introspection will be valid and that token will be cached. The problem comes when a second requests to an endpoint that requires the scope `bar` is made before the cache has expired. Whether the token is granted or not to the `bar` scope, introspection will be valid.

    ### Patches

    A patch will be released with `v0.38.12-beta.1`.

    ### Workarounds

    Per default, caching is disabled for the `oauth2_introspection` authenticator. When caching is disabled, this vulnerability does not exist.

    ### Trace

    The cache is checked in [`func (a *AuthenticatorOAuth2Introspection) Authenticate(...)`](https://github.com/ory/oathkeeper/blob/6a31df1c3779425e05db1c2a381166b087cb29a4/pipeline/authn/authenticator_oauth2_introspection.go#L152). From [`tokenFromCache()`](https://github.com/ory/oathkeeper/blob/6a31df1c3779425e05db1c2a381166b087cb29a4/pipeline/authn/authenticator_oauth2_introspection.go#L97) it seems that it only validates the token expiration date, but ignores whether the token has or not the proper scopes.

    ### Post-Mortem

    The vulnerability was introduced in PR #424. During review, we failed to require appropriate test coverage by the submitter which is the primary reason that the vulnerability passed the review process.

    To avoid this from happening again we enabled codecov with a strict policy on the Ory Oathkeeper repository: Without an increase in code coverage the PR can not be merged.

    To address this issue and any regressions we have added a test suite ensuring that the cache behaviour is correct in the different scenarios:

    - Scope strategy is `none`, cache is enabled, and `requested_scope` is not empty -> cache will not be used;
    - Scope strategy is `none`, cache is enabled, and `requested_scope` is empty -> cache will be used;
    - Scope strategy is not `none`, cache is enabled, and `requested_scope` is not empty -> cache will be used;

    as well as validating if `iss`, `aud`, `exp`, `token_use`, and scope are validated.

    Additionally, we added [CodeQL scanning](https://github.com/ory/oathkeeper/commit/64ac7562669287d391cd72dfd43c5d71ff9f89a1) to the CI.
published: 2021-06-23T18:00:20Z
last_modified: 2021-06-23T18:00:20Z
ghsas:
  - GHSA-qvp4-rpmr-xwrr

@neild
Copy link
Contributor

neild commented Jun 15, 2022

Vulnerability in tool.

@neild neild closed this as completed Jun 15, 2022
@neild neild added excluded: EFFECTIVELY_PRIVATE This vulnerability exists in a package can be imported, but isn't meant to be outside that module. and removed NotGoVuln labels Aug 11, 2022
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/592767 mentions this issue: data/reports: unexclude 50 reports

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/607217 mentions this issue: data/reports: unexclude 20 reports (15)

gopherbot pushed a commit that referenced this issue Aug 21, 2024
  - data/reports/GO-2022-0367.yaml
  - data/reports/GO-2022-0368.yaml
  - data/reports/GO-2022-0369.yaml
  - data/reports/GO-2022-0372.yaml
  - data/reports/GO-2022-0374.yaml
  - data/reports/GO-2022-0375.yaml
  - data/reports/GO-2022-0377.yaml
  - data/reports/GO-2022-0378.yaml
  - data/reports/GO-2022-0381.yaml
  - data/reports/GO-2022-0387.yaml
  - data/reports/GO-2022-0388.yaml
  - data/reports/GO-2022-0389.yaml
  - data/reports/GO-2022-0390.yaml
  - data/reports/GO-2022-0392.yaml
  - data/reports/GO-2022-0393.yaml
  - data/reports/GO-2022-0395.yaml
  - data/reports/GO-2022-0396.yaml
  - data/reports/GO-2022-0398.yaml
  - data/reports/GO-2022-0405.yaml
  - data/reports/GO-2022-0406.yaml

Updates #367
Updates #368
Updates #369
Updates #372
Updates #374
Updates #375
Updates #377
Updates #378
Updates #381
Updates #387
Updates #388
Updates #389
Updates #390
Updates #392
Updates #393
Updates #395
Updates #396
Updates #398
Updates #405
Updates #406

Change-Id: I001f245aa4d9225668c2b30e3d5b4ca7a7e9b3b3
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/607217
Commit-Queue: Tatiana Bradley <tatianabradley@google.com>
Auto-Submit: Tatiana Bradley <tatianabradley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
excluded: EFFECTIVELY_PRIVATE This vulnerability exists in a package can be imported, but isn't meant to be outside that module.
Projects
None yet
Development

No branches or pull requests

4 participants