Skip to content

Add initial warnings against OHTTP request reuse#828

Merged
nothingmuch merged 1 commit intopayjoin:masterfrom
0xZaddyy:docs/ohttp-no-reuse-warning-819
Jul 2, 2025
Merged

Add initial warnings against OHTTP request reuse#828
nothingmuch merged 1 commit intopayjoin:masterfrom
0xZaddyy:docs/ohttp-no-reuse-warning-819

Conversation

@0xZaddyy
Copy link
Contributor

@0xZaddyy 0xZaddyy commented Jun 30, 2025

Document OHTTP Request Non-Reusability

This PR addresses #819 by documenting that OHTTP-encapsulated requests must not be reused or retried, due to the risk of retransmitting ciphertext and violating OHTTP's privacy guarantees.

What's Included:

A top-level warning was added to the receive module docs (//!) to highlight the security implications of request reuse.

Closes #819

@0xZaddyy 0xZaddyy force-pushed the docs/ohttp-no-reuse-warning-819 branch from 17beeee to f01dffa Compare June 30, 2025 19:59
@coveralls
Copy link
Collaborator

coveralls commented Jun 30, 2025

Pull Request Test Coverage Report for Build 16027685870

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 84.896%

Totals Coverage Status
Change from base Build 16014856746: 0.0%
Covered Lines: 7251
Relevant Lines: 8541

💛 - Coveralls

Copy link
Collaborator

@nothingmuch nothingmuch left a comment

Choose a reason for hiding this comment

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

Is This the Right Direction?

Yes =)

I posted some comments elaborating on the rationale.

Something to keep in mind is not to over-state the benefit of avoiding reuse, for example in the event that both the sender and receiver use the same relay there would still be some concern about linking them together as participants in the same session and even inferring who is the receiver and who is the sender. If the encapsulated GET requests are reused that would make it much easier for a relay to infer that information, but ensuring each encapsulated request is fresh doesn't fully prevent that.


impl WithReplyKey {
/// Important: This request must not be retried or reused on failure.
/// Retransmitting the same ciphertext breaks OHTTP security properties.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// Retransmitting the same ciphertext breaks OHTTP security properties.
/// Retransmitting the same ciphertext breaks OHTTP privacy properties.

The specific concern is that the relay can see that a request is being retried, which leaks that it's all the same polling request.

//!
//! OHTTP-encapsulated requests—whether GET or POST—**must not be retried or reused**.
//!
//! Reusing an encapsulated request may retransmit the same ciphertext, which breaks the
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
//! Reusing an encapsulated request may retransmit the same ciphertext, which breaks the
//! Reusing an encapsulated request will retransmit the same ciphertext, which breaks the

the encapsulated request is a header followed by the ciphertext, so if it's POSTed twice to the relay, the relay can observe that it is the same as in the previous request

those two requests can aleady be linked by the relay due to metadata, e.g. ip address, but seeing repeats additionally reveals information about how the client is interacting with the directory

//! OHTTP-encapsulated requests—whether GET or POST—**must not be retried or reused**.
//!
//! Reusing an encapsulated request may retransmit the same ciphertext, which breaks the
//! anonymity and unlinkability guarantees provided by the OHTTP protocol.
Copy link
Collaborator

Choose a reason for hiding this comment

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

git complains about trailing spaces, so best to filter these out for the whole file

Suggested change
//! anonymity and unlinkability guarantees provided by the OHTTP protocol.
//! anonymity and unlinkability guarantees provided by the OHTTP protocol.

@0xZaddyy 0xZaddyy force-pushed the docs/ohttp-no-reuse-warning-819 branch 6 times, most recently from 09f7bdb to 3d56cc3 Compare July 2, 2025 08:09
@0xZaddyy 0xZaddyy marked this pull request as ready for review July 2, 2025 08:10
@0xZaddyy 0xZaddyy marked this pull request as draft July 2, 2025 08:11
@0xZaddyy
Copy link
Contributor Author

0xZaddyy commented Jul 2, 2025

Is This the Right Direction?

Yes =)

I posted some comments elaborating on the rationale.

Something to keep in mind is not to over-state the benefit of avoiding reuse, for example in the event that both the sender and receiver use the same relay there would still be some concern about linking them together as participants in the same session and even inferring who is the receiver and who is the sender. If the encapsulated GET requests are reused that would make it much easier for a relay to infer that information, but ensuring each encapsulated request is fresh doesn't fully prevent that.

Thanks! I’ve made a few corrections
Could you let me know if the locations I placed the warnings are appropriate?
Also, is the structure and phrasing of the warnings aligned with what you had in mind?

If there are other places where you'd prefer to see these comments added or removed I’d really appreciate the suggestions.

Copy link
Collaborator

@nothingmuch nothingmuch left a comment

Choose a reason for hiding this comment

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

Could you let me know if the locations I placed the warnings are appropriate?

Yeah, I think the module level stuff on v2 sender & receiver is the right place

Also, is the structure and phrasing of the warnings aligned with what you had in mind?

Yep! I've made some suggestions, and corrections re v1 stuff that doesn't use OHTTP

@0xZaddyy 0xZaddyy force-pushed the docs/ohttp-no-reuse-warning-819 branch from 3d56cc3 to 274cc15 Compare July 2, 2025 12:47
@0xZaddyy 0xZaddyy marked this pull request as ready for review July 2, 2025 12:51
@0xZaddyy
Copy link
Contributor Author

0xZaddyy commented Jul 2, 2025

Alright boss, fixed.
Thanks ^▽^

Copy link
Collaborator

@nothingmuch nothingmuch left a comment

Choose a reason for hiding this comment

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

please verify that all methods with the warning are definitely related to v2, that the request is actually an OHTTP encapsulated one, and that "polling request" vs. just "request" is consistent

@0xZaddyy 0xZaddyy force-pushed the docs/ohttp-no-reuse-warning-819 branch 2 times, most recently from 1b01a1b to 1dcebdf Compare July 2, 2025 14:11
@0xZaddyy 0xZaddyy requested a review from nothingmuch July 2, 2025 14:16
Adds a security warning to the top level `receive` module docs to clarify that
OHTTP-encapsulated requests (GET and POST) must not be retried or reused.

Reusing an encapsulated request can retransmit identical ciphertext, violating
OHTTP's privacy guarantees.
@0xZaddyy 0xZaddyy force-pushed the docs/ohttp-no-reuse-warning-819 branch from 1dcebdf to 372c360 Compare July 2, 2025 14:18
@0xZaddyy
Copy link
Contributor Author

0xZaddyy commented Jul 2, 2025

All corrections have been made, boss!

@nothingmuch nothingmuch merged commit 10d90cf into payjoin:master Jul 2, 2025
13 checks passed
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.

document that OHTTP requests should not be reused

3 participants