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

hs2019 is not supported as a http signature algorithm, breaking Federation #4431

Closed
gabek opened this issue Sep 24, 2021 · 8 comments
Closed

Comments

@gabek
Copy link

gabek commented Sep 24, 2021

PeerTube is using https://github.com/joyent/node-http-signature who is currently not adhering to the current http signature best practices by not supporting the hs2019 algorithm. There is a PR resolving this with the library who adds some context:

This allows the recommended use of "hs2019" as algorithm, that effectively hides the used algorithm from the signature to avoid attacks, see Appendix E.2 in https://tools.ietf.org/html/draft-cavage-http-signatures-12

TritonDataCenter/node-http-signature#105

But there are other PRs linked in the original issue: TritonDataCenter/node-http-signature#106.

While I know this isn't directly a PeerTube issue, it is breaking federation with other services, so I'm hoping PeerTube can chime in on the above to hopefully push through some resolution so PeerTube can be fully compatible with http signatures. If that library is not going to update then maybe PeerTube may have to move to another library in order to get up to date.

@rigelk rigelk added Component: Federation 🎡 Status: Blocked ✋ Somehow, somewhere *else*, something has gone very wrong. Until they fix it we're stuck. labels Sep 25, 2021
@gabek
Copy link
Author

gabek commented Oct 22, 2021

Hi there. I noticed there's been no activity from PeerTube on the above links. Is there any plan to resolve this incompatibility outside of relying on the outdated and inactive dependency to fix it?

@rigelk
Copy link
Collaborator

rigelk commented Oct 22, 2021

Ultimately it really depends on the urgency. The above linked PRs are not yet merged, but might deserve some more waiting, don't you think?

Could you expand on the "breaking federation with other services" to better evaluate the above?

@gabek
Copy link
Author

gabek commented Oct 22, 2021

It was first reported to your dependency library two years ago, and no movement has taken place since then. It's likely without some prodding from large projects who depend on that library (PeerTube) it will continue to be stalled.

You could continue to wait, but two years is a long time, and in the mean time it's blocking support for additional federation. I know people would like to see Owncast federate with PeerTube, for example.

As for the actual issue, PeerTube is rejecting inbound federated activities that are signed with hs2019. I'll get the actual log message shortly.

@rigelk
Copy link
Collaborator

rigelk commented Oct 22, 2021

I guess https://npm.io/package/@jolocom/http-signature could fit the bill in the meantime.

@Chocobozzz
Copy link
Owner

I'll create a dedicated http signature npm package for peertube then :/

@Chocobozzz Chocobozzz self-assigned this Oct 22, 2021
@Chocobozzz Chocobozzz added Priority: High and removed Status: Blocked ✋ Somehow, somewhere *else*, something has gone very wrong. Until they fix it we're stuck. labels Oct 22, 2021
@gabek
Copy link
Author

gabek commented Oct 22, 2021

Thank you!

@Chocobozzz
Copy link
Owner

You can test hs2019 on https://peertube2.cpy.re/about/instance. If you have issues please contact me by email (in my github profile).

@vpzomtrrfrt
Copy link

If I'm reading this correctly, this implementation assumes hs2019 signatures are sha512 signatures, while most of the fediverse currently uses sha256. In theory, the algorithm should be derived from metadata about the key, but how exactly to do that is still undefined (see https://socialhub.activitypub.rocks/t/state-of-http-signatures/754)

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

No branches or pull requests

4 participants