Skip to content

Cap the ohttp key body size from directory - #1846

Merged
benalleng merged 1 commit into
payjoin:masterfrom
benalleng:unbounded-key-res
Sep 9, 2026
Merged

benalleng merged 1 commit into
payjoin:masterfrom
benalleng:unbounded-key-res

Conversation

@benalleng

@benalleng benalleng commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

This caps the key config fetch size from the directory to limit any malicious directory from sending oversized data on key fetch.

Coded with GLM-5.3

Pull Request Checklist

Please confirm the following before requesting review:

@coveralls

coveralls commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 33902922471

Coverage increased (+0.006%) to 86.646%

Details

  • Coverage increased (+0.006%) from the base build.
  • Patch coverage: 9 uncovered changes across 2 files (67 of 76 lines covered, 88.16%).
  • 1 coverage regression across 1 file.

Uncovered Changes

File Changed Covered %
payjoin-cli/src/app/v2/ohttp.rs 6 0 0.0%
payjoin/src/core/io.rs 70 67 95.71%

Coverage Regressions

1 previously-covered line in 1 file lost coverage.

File Lines Losing Coverage Coverage
payjoin/src/core/io.rs 1 70.97%

Coverage Stats

Coverage Status
Relevant Lines: 16549
Covered Lines: 14339
Line Coverage: 86.65%
Coverage Strength: 341.61 hits per line

💛 - Coveralls

@benalleng benalleng changed the title Cap the ohttp key body size Cap the ohttp key body size from directory Aug 26, 2026

@xstoicunicornx xstoicunicornx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed with Opus 4.8 and Sol 5.6, compiled and unslopped the feedback as best I could. Please let me know if any of it is not quite right/applicable.

CLI follow-up found during review - handle OhttpKeysBodyTooLarge as a directory failure instead of as a relay failure (see 199412b).

Comment thread payjoin/src/core/io.rs Outdated
Comment thread payjoin/src/core/io.rs Outdated
Comment thread payjoin/src/core/io.rs Outdated
Comment thread payjoin/src/core/io.rs Outdated
Comment thread payjoin/src/core/io.rs Outdated
This caps the key cofig fetch size from the directory to limit any
malicious directory from sending oversized data on key fetch.

Treat oversized keys as directory failures

An oversized OHTTP key response originates from the directory, not
the CONNECT relay. Mark the directory as failed and return instead of
excluding each relay while retrying the same response.

Co-authored-by: xstoicunicornx <xstoicunicornx@users.noreply.github.com>

@xstoicunicornx xstoicunicornx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ACK 8fff253

All feedback has been addressed including the follow up. Looks good.

@benalleng
benalleng merged commit e4eddca into payjoin:master Sep 9, 2026
19 checks passed
@DanGould DanGould mentioned this pull request Sep 23, 2026
14 tasks
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.

3 participants