Skip to content

Curl does not parse correctly the "qop=" parameter of Digest authentication #9264

Closed

Description

@vlubart

When parsing the "qop=" parameter of the digest authentication Curl uses “,” delimiter. See function auth_digest_get_qop_values() in

token = strtok_r(tmp, ",", &tok_buf);
:
token = strtok_r(tmp, ",", &tok_buf);
The same at
token = strtok_r(NULL, ",", &tok_buf);
.

According to RFC https://www.ietf.org/rfc/rfc7616.html the qop delimiter can actually include a whitespace , as in the example that appears in the RFC :
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Digest
realm="http-auth@example.org",
qop="auth, auth-int",
(comma-whitespace instead of just comma)

In this case Curl would wrongly parse a token " auth-int" (with leading whitespace) instead of just "auth-int".
Found on Ubuntu 21.04

Activity

  1. added a commit that references this issue on Aug 7, 2022
    657ad6e
  2. self-assigned this
    on Aug 7, 2022
  3. vlubart commented on Aug 8, 2022

    @vlubart
    Author

    Thanks for the quick resolution! When a release with this fix can be expected ?

  4. bagder commented on Aug 8, 2022

    @bagder
    Member

    This fix will be included in the next release. 7.85.0 is expected to ship on August 31.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions