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

bug: hmac-auth plugin will cause error when use duplicate signature header #11126

Closed
ronething opened this issue Apr 8, 2024 · 1 comment · Fixed by #11127
Closed

bug: hmac-auth plugin will cause error when use duplicate signature header #11126

ronething opened this issue Apr 8, 2024 · 1 comment · Fixed by #11127
Assignees
Labels
bug Something isn't working

Comments

@ronething
Copy link
Contributor

Current Behavior

when use duplicate signature header, hmac auth plugin will panic and return 500

Expected Behavior

In APISIX, most of the obtained headers are used directly as strings. Only a few scenarios may be used as arrays, which need to be checked to ensure that the data is used as expected to avoid errors.

If it's a bug, please assign this issue to me, we can change core.request.header function return string instead of table to avoid this problem.

Error Logs

image

Steps to Reproduce

1、run apisix with master branch
2、add duplicate signature header in TEST 16: verify: invalid signature to file t/plugin/hmac-auth.t

--- more_headers
X-HMAC-SIGNATURE: asdf
X-HMAC-SIGNATURE: asdf

3、run test case for t/plugin/hmac-auth.t, and you can see 500 Internal Server Error

Environment

  • APISIX version (run apisix version):
  • Operating system (run uname -a):
  • OpenResty / Nginx version (run openresty -V or nginx -V):
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):
  • APISIX Dashboard version, if relevant:
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version):
@starsz
Copy link
Contributor

starsz commented Apr 8, 2024

It's a bug, assigned to you to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants