Skip to content

SES 1.8.0 adds flexibility to Lockdown

Agoric has released ses version 1.8.0 with more implementation-specific options to Hardened JavaScript’s lockdown() function to improve ecosystem compatibility.

Regenerator Runtime Compatibility

Old versions of some npm packages used regenerator to anticipate JavaScript’s async functions before language support was ubiquitous. These rely on regenerator-runtime to approximate the language feature. However, in the few cases where a dependency on versions 0.10.5 to 0.13.7 of regenerator-runtime persist, applications are incompatible with ses due to misalignment of the global objects the runtime introduces and the environment that Hardened JavaScript expects from the base language.

With SES 1.8.0, lockdown accepts a new option legacyRegeneratorRuntimeTaming: 'unsafe-ignore' that repairs the intrinsics shared by all compartments so that lockdown will allow them. This remediation is not strictly safe because it converts Iterator.prototype[Symbol.iterator] to a getter and setter, such that all assignments to it are ignored. This could cause code to procede on false assumption that it successfully overwrote the Iterator.prototype[Symbol.iterator] instead of throwing an error.

Error Trapping: Report

Starting with SES 1.8.0, the 'report' mode for the errorTrapping option to lockdown will write errors to standard error with the new "SES_UNCAUGHT_EXCEPTION: " prefix. The 'report' mode is sometimes implied by 'platform', 'exit', or 'abort'. This is intended to give valuable context to users of the system, especially when an uncaught exception is not an Error object, and therefore its origin may be hard to find in source code.

This is not likely to affect most systems built with SES, as stderr is generally reserved for user-only messages. If your SES system sends its stderr to a program which parses it, you may need to adapt that program to be tolerant of the SES_UNCAUGHT_EXCEPTION: prefix. Even for such programs, it is unlikely they are that sensitive to stderr formatting.