Repository navigation
feat(documents): harden the anytopdf conversion node and add Check it - #224
Merged
Merged
Conversation
Lens no longer follows a redirect from a conversion node (so its bearer token stays at the address set), refuses an address that isn't plain http(s), caps the node's job answers at 1 MB and its PDF at 2 GB, checks the job id and that the PDF starts like one. Settings > Documents gets a Check it button that asks the node for a job with Lens's token. The threat model gains P-CONVERSION-NODE in the prose, YAML and JSON. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UjMfekKJM7pXVCzm7EVPDy
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UjMfekKJM7pXVCzm7EVPDy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<
6AE9
svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert">
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
Description
Before: Lens followed a conversion node's redirects with its bearer token attached, read the node's answers and PDF with no size limit, and took whatever bytes came back as the PDF. There was no way to test the node from Settings.
After: a node that redirects is refused, so the token stays at the address set. The address must be http(s) with no user name or password. Job answers are read to 1 MB, the PDF to 2 GB, the job id must look like an id, and a PDF that doesn't start with
%PDF-is refused (partial files are cleaned up). Settings › Documents shows a Check it button under the conversion node that asks the node for a job with Lens's token and reports whether it answered and took it (POST /api/v1/settings/documents/node/test).The threat model gains P-CONVERSION-NODE in
threat-model.md,.yamland.json(prose hash updated;ci/validate_threat_model.pypasses), and B3 now names anytopdf.Motivation and Context
Hardening for the conversion node added in #210 / #220.
Types of changes
!in the title)Checklist:
docs/accordingly (docs/configuration.md#anytopdf).## UnreleasedinCHANGELOG.md.OpenAPI and the frontend client regenerated with
make openapi's commands.🤖 Generated with Claude Code
https://claude.ai/code/session_01UjMfekKJM7pXVCzm7EVPDy
Generated by Claude Code