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

Remove HMAC-MD5 support from TSIG #1187

Merged
merged 1 commit into from
Oct 24, 2020
Merged

Conversation

tmthrgd
Copy link
Collaborator

@tmthrgd tmthrgd commented Oct 23, 2020

The Wikipedia article for TSIG claims that HMAC-MD5 is "still in common usage", but doesn't provide any source for this. If there's no one who desperately needs this, I'd like to remove it entirely.

MD5 is a severely broken algorithm so it would be great to get it out of this library, even removing legacy support.

Considering that the TSIG algorithm is set by the TSIG record and not by the secret key (!! see the JWT token mess), an exploitable weakness in HMAC-MD5 could allow easy forging of TSIG records even on systems that do not otherwise use MD5.

@tmthrgd tmthrgd requested a review from miekg October 23, 2020 07:35
Copy link
Owner

@miekg miekg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might need IETF action, but I agree with the sentiment of just removing this.

@miekg miekg merged commit 93945c2 into miekg:master Oct 24, 2020
@tmthrgd tmthrgd deleted the no-tsig-hmac-md5 branch October 24, 2020 12:02
@tmthrgd
Copy link
Collaborator Author

tmthrgd commented Oct 24, 2020

@miekg It would be good to have it formally deprecated. This is an easy revert at least if people need HMAC-MD5 and can’t easily update.

@apantelopoulosNS1
Copy link

Hey @miekg, I am part of the DNS team in NS1 and just saw that the support for hmac-md5 algorithm is removed. Unfortunately, our customers still make heavy use of this algorithm in our systems thus we have to support it. Further, RFC https://tools.ietf.org/html/rfc6151 also states that it is not urgent to stop using HMAC-MD5 (Section 2, Security Considerations).

We have a plan of migrating customers eventually away from hmac-md5, but this will take time. In the meantime, is it possible to re-add support for it in the library since it prohibits us from updating to newer versions?

@tmthrgd
Copy link
Collaborator Author

tmthrgd commented Feb 1, 2021

@apantelopoulosNS1 That is quite unfortunate, ridding this library of ancient algorithms is definitely a goal of mine. I would encourage you to migrate as promptly as you can, because it really isn’t a good algorithm or something that should be kept around anywhere at all.

Just for the record RFC 6151 is now a full decade old, so I wouldn’t rush to it for security advice. I can’t seem to find much recent discussion on how secure HMAC-MD5 is or isn’t though.

I can open a revert PR, but now we have a TsigProvider you could potentially quite trivially implement it yourself by copying the built in HMAC provider code and adding it. Would that satisfy your use case or shall I open a revert PR?

@apantelopoulosNS1
Copy link

Hello @tmthrgd, thanks for responding so quickly! We decided to use TsigProvider as you pointed out to implement this functionality, thus there is no need for a revert PR. 👍

middelink added a commit to middelink/lego-tlsa that referenced this pull request Jun 5, 2021
…to hmacSHA256

Also FQDN the tsigAlgo, else it complains about unqualified domains.
@dmavrommatis
Copy link
Contributor

@tmthrgd hey! I have a question regarding the TsigProvider interface. It seems that the provider functions are not exposed and we can't use them?

(original comment/question)
#1254 (comment)

@dmavrommatis
Copy link
Contributor

@tmthrgd I think TsigProvider is not in a state that can be used right now. It's only supported when you are client and there is no use of it in xfr or server.

Also, the TsigProvider does not support using the current secret for the processed packet so when acting as a server you should know all the secrets beforehand which is not always possible.
https://github.com/miekg/dns/blob/master/client.go#L349
co.TsigSecret[t.Hdr.Name] vs just co.TsigProvider

This makes support of MD5 nearly impossible unless we change the whole TsigProvider implementation to also use the t.Hdr.Name which breaks backwards compatibility.

Please tell me if I am wrong with the above mentioned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants