Skip to content

traefik no longer url escape X-Forwarded-Tls-Client-Cert header #9143

Closed

Description

@Aetf

stdiscosrv has the ability to handle certificates passed by traefik proxy server in X-Forwarded-Tls-Client-Cert header.

Previously, traefik url encodes the content but it stopped doing so since version v2.9.4.
This becomes troublesome for setups where stdiscosrv sits behind newer traefik versions,
as now stdiscosrv tries to url decode the header content when it is not encoded.

The symptom can be very confusing, as if some client's certificate's pem text happens to not contain +, etc, then it works perfectly, but other clients will always fail announcement with 403 error.

More details can be found at traefik/traefik#9669.

I'm not sure what should be the best strategy here to support both old and new traefik versions... but wanted to at least raise attention.

stdiscosrv version: 1.24.0

Activity

  1. added
    bug
    needs-triage
    on Sep 30, 2023
  2. added a commit that references this issue on Oct 6, 2023
    beb4e91
  3. removed
    needs-triage
    on Oct 6, 2023
  4. Aetf commented on Oct 9, 2023

    @Aetf
    Author

    Hi @calmh, thank you so much for the fast fix! I can test it when I get time. But from reading the code, it doesn't seem to solve the issue.

    Consider the following case:

    X-Forwarded-Tls-Client-Cert: ABCDEFG+XYZ
    

    URL unescape will complete without error, generating string ABCDEFG XYZ. The failure will happen down the line when try to do PEM decode on the string. This is actually no different from the behavior before the fix.

    IMHO maybe a better fix is to check for the presence of % character, like what's done for X-SSL-Cert for nginx.

  5. reopened this on Oct 9, 2023
  6. calmh commented on Oct 9, 2023

    @calmh
    Member

    Lovely, I forgot that plus is a valid Base64 character.

  7. added a commit that references this issue on Oct 14, 2023
    afaa98a
  8. added a commit that references this issue on Oct 15, 2023
    917698d
  9. added this to the v1.26.0 milestone on Oct 24, 2023
  10. added 2 commits that reference this issue on Jan 28, 2024
    690b553
    a405c21
  11. added
    frozen-due-to-age
    on Apr 9, 2025
  12. locked and limited conversation to collaborators on Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfrozen-due-to-age

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions