Skip to content

attachments: validate file encryption inputs - #129

Merged
jagerman merged 1 commit into
session-foundation:devfrom
Ap4sh:validate-attachment-file-inputs
Aug 24, 2026
Merged

attachments: validate file encryption inputs#129
jagerman merged 1 commit into
session-foundation:devfrom
Ap4sh:validate-attachment-file-inputs

Conversation

@Ap4sh

@Ap4sh Ap4sh commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

summary

the file-based attachment encryption overloads currently read 32 bytes from seed without checking its size, unlike the buffer overloads. they also ignore allow_large, so files above MAX_REGULAR_SIZE are accepted when the flag is false

this validates both inputs before hashing the file while keeping oversized file support when allow_large=true

tests

  • ./Build/tests/testAll "Attachment file encryption validates its inputs"
  • ./Build/tests/testAll "[attachments]"
  • ./Build/tests/testAll
  • ./utils/ci/drone-format-verify.sh

@jagerman

Copy link
Copy Markdown
Member

I've also chased down the equivalent code (which is vastly rewritten) in the pfs branch, and these exceptions match what is raised there.

@jagerman
jagerman merged commit ce82717 into session-foundation:dev Aug 24, 2026
1 check 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.

2 participants