You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From UUEncode only decoded complete four-character groups, so a line that lost its trailing characters dropped the bytes they belonged to. That happens a lot in practice: encoders that write a space for zero (Python's binascii.b2a_uu by default) end lines with spaces, and editors or mail clients strip them. Hello encodes as %2&5L;&\ and once the trailing space is gone DecodeBox gave back Hel. The decoder already meant to read a missing character as zero (|| 96), but the loop stopped before it got there. It now keeps going until the line's length byte is satisfied, which matches binascii.a2b_uu.
Related issue
none
How it was tested
New case in operations.verified.test.ts next to the UUencode round trip: %2&5L;&\ and %2&5L;&\ both give Hello, and #0P gives 43 00 00 (same as binascii.a2b_uu). It fails on main.
Locally on Node 24 and Node 22: npm run lint, npm run typecheck, npm run test -- --run (1273 passed), npm run build and npm run check:sdk-dist, plus the CI Chrome load check, the GraalJS Java provider checks and npm audit --audit-level=high.
Checklist
npm run lint, npm run typecheck, npm run test and npm run build all pass locally
Tests added or updated, including a case that would have failed before this change
No any introduced in application code
No eval, new Function, dangerouslySetInnerHTML, or innerHTML assignment
No new runtime dependency (or it was discussed in an issue first, linked above)
User-facing strings go through the i18n map (no new strings)
Layout / RTL and keyboard checks (no UI change)
Malformed and hostile input handled without crashing or hanging the tab
One resource-exhaustion issue needs to be addressed before merging.
In fromUuencode(), decoded bytes are accumulated in the out array without checking the engine's MAX_OUTPUT limit (16 MiB).
The size check in bake() happens only after the operation returns. This means the decoder can allocate an oversized output before the existing protection is applied.
For example, a relatively small input containing many _ lines (each declaring 63 output bytes) can exceed the 16 MiB limit and potentially cause excessive memory consumption.
Please:
Enforce the output limit incrementally before decoding or allocating each line. For example, use checkSize(out.length + length) from ../runtime/limits before creating the decoded array.
Add a regression test that verifies inputs exceeding MAX_OUTPUT are rejected with the expected error.
Ensure the limit is enforced before excessive memory allocation, not only after decoding finishes.
Thanks for catching that. fromUuencode() now calls checkSize(out.length + length) before it decodes each line, so it stops with the usual "Output exceeds the processing limit" error before the array grows past MAX_OUTPUT. The new test feeds 266,306 _ lines (one line past 16 MiB) straight into the operation's run, so it doesn't rely on the check in bake(), and it fails without the fix. Pushed in efb10fb.
This branch has not been deployed
No deployments
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
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.
What this changes
From UUEncode only decoded complete four-character groups, so a line that lost its trailing characters dropped the bytes they belonged to. That happens a lot in practice: encoders that write a space for zero (Python's
binascii.b2a_uuby default) end lines with spaces, and editors or mail clients strip them.Helloencodes as%2&5L;&\and once the trailing space is gone DecodeBox gave backHel. The decoder already meant to read a missing character as zero (|| 96), but the loop stopped before it got there. It now keeps going until the line's length byte is satisfied, which matchesbinascii.a2b_uu.Related issue
none
How it was tested
New case in
operations.verified.test.tsnext to the UUencode round trip:%2&5L;&\and%2&5L;&\both giveHello, and#0Pgives43 00 00(same asbinascii.a2b_uu). It fails on main.Locally on Node 24 and Node 22:
npm run lint,npm run typecheck,npm run test -- --run(1273 passed),npm run buildandnpm run check:sdk-dist, plus the CI Chrome load check, the GraalJS Java provider checks andnpm audit --audit-level=high.Checklist
npm run lint,npm run typecheck,npm run testandnpm run buildall pass locallyanyintroduced in application codeeval,new Function,dangerouslySetInnerHTML, orinnerHTMLassignment