Skip to content

fix(dingtalk-auth): clear client-supplied X-Userinfo before authentication#13491

Merged
shreemaan-abhishek merged 1 commit into
apache:masterfrom
shreemaan-abhishek:fix/dingtalk-auth-clear-userinfo2
Jun 10, 2026
Merged

fix(dingtalk-auth): clear client-supplied X-Userinfo before authentication#13491
shreemaan-abhishek merged 1 commit into
apache:masterfrom
shreemaan-abhishek:fix/dingtalk-auth-clear-userinfo2

Conversation

@shreemaan-abhishek

Copy link
Copy Markdown
Contributor

Description

The dingtalk-auth plugin sets the X-Userinfo request header from the
verified session, but only when set_userinfo_header is true. When it is
false, a client-supplied X-Userinfo header was left untouched and
forwarded to the upstream as-is.

This aligns dingtalk-auth with the sibling feishu-auth plugin, which
already clears X-Userinfo unconditionally at the start of its rewrite
phase. The header is now always cleared first, so the upstream only ever
receives an X-Userinfo value set by APISIX (or none, when
set_userinfo_header is false).

A regression test is added covering both set_userinfo_header settings.

Which issue(s) this PR fixes:

Fixes #

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

…ation

The dingtalk-auth plugin populates the X-Userinfo request header from the
verified session, but only when set_userinfo_header is true. When it is
false, a client-supplied X-Userinfo was left untouched and forwarded to
the upstream. Clear the header unconditionally at the start of the rewrite
phase, matching the sibling feishu-auth plugin, so the upstream only ever
sees an X-Userinfo set by APISIX. Adds a regression test.
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Jun 9, 2026
@shreemaan-abhishek
shreemaan-abhishek merged commit e2671c4 into apache:master Jun 10, 2026
19 checks passed
wistefan pushed a commit to wistefan/apisix that referenced this pull request Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants