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

JWT Plugin bypasses validation process occasionally on frequent requests #13050

Closed
1 task done
ram-appsentinels opened this issue May 20, 2024 · 5 comments
Closed
1 task done
Labels
pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... stale

Comments

@ram-appsentinels
Copy link

ram-appsentinels commented May 20, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Kong version ($ kong version)

2.8.1

Current Behavior

Dear Team,
I’m currently running Kong within a Docker container, along with the JWT plugin. My setup involves a Flask web server operating behind Kong, with JWT validation enabled at the Kong level. When I send a request via Postman with an invalid signature bearer token or an invalid algorithm, I receive an “Invalid alg or invalid signature” response. However, upon frequent requests, I’ve observed occasional bypassing of the validation process from Kong side and reaches my flask server.
Thanks in Advance.

Expected Behavior

It should throw exception.

Steps To Reproduce

Took the valid bearer token, made a request and it passed through it. With the same valid token, i manually tampered the token making invalid algorithm and made a request using postman. Initial request got a exception, but on frequent request occasionally getting bypassed

Anything else?

No response

@brentos
Copy link
Contributor

brentos commented May 20, 2024

@ram-appsentinels Could you share your JWT plugin config?

@ram-appsentinels
Copy link
Author

Sure @brentos

{
  "id": "336655f6-f9cf-406e-9bda-2206ea1a8ed3",
  "service": {
    "id": "80da1c7e-5006-452e-b5a6-b09add7465ec"
  },
  "created_at": 1715827820,
  "tags": null,
  "name": "jwt",
  "enabled": true,
  "consumer": null,
  "protocols": [
    "grpc",
    "grpcs",
    "http",
    "https"
  ],
  "config": {
    "uri_param_names": [
      "jwt"
    ],
    "cookie_names": [],
    "header_names": [
      "authorization"
    ],
    "claims_to_verify": [
      "exp"
    ],
    "maximum_expiration": 0,
    "run_on_preflight": true,
    "anonymous": null,
    "key_claim_name": "iss",
    "secret_is_base64": false
  },
  "route": null
}

@brentos
Copy link
Contributor

brentos commented May 21, 2024

@ram-appsentinels I'm not able to reproduce this, can you provide all reproduction steps? Kong configuration, consumer creation, jwt creation, etc?

@chronolaw chronolaw added the pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... label May 22, 2024
Copy link
Contributor

github-actions bot commented Jun 5, 2024

This issue is marked as stale because it has been open for 14 days with no activity.

@github-actions github-actions bot added the stale label Jun 5, 2024
Copy link
Contributor

Dear contributor,

We are automatically closing this issue because it has not seen any activity for three weeks.
We're sorry that your issue could not be resolved. If any new information comes up that could
help resolving it, please feel free to reopen it.

Your contribution is greatly appreciated!

Please have a look
our pledge to the community
for more information.

Sincerely,
Your Kong Gateway team

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... stale
Projects
None yet
Development

No branches or pull requests

3 participants