endojs / endo

Endo is a distributed secure JavaScript sandbox, based on SES
Apache License 2.0
829 stars 72 forks source link

fix(netstring): Early return during chunked write #1790

Closed kriskowal closed 1 year ago

kriskowal commented 1 year ago

Description

@kumavis identified in review a defect in the chunked mode for netstring writer. This change includes tests for the case where the target writer closes while we attempt to write netstring chunks, and provides the fix. Both tests previously failed.

Security Considerations

Previously, writing to a netstring writer could mistakenly indicate that the stream was still open after the target closed, possibly reducing availability.

Scaling Considerations

This should not have a material impact on scale, but might plug a memory leak.

Documentation Considerations

No changes.

Testing Considerations

The behaviors changed are covered by the unit tests.

Upgrade Considerations

This should not create an obstacle for upgrades.