Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): remove vendored lockdown.umd.js #1081

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

boneskull
Copy link
Contributor

This removes the vendored lib/lockdown.umd.js.

ses does not actually export its dist/lockdown.umd.js. It does export dist/ses.cjs as lockdown. dist/ses.cjs is identical to dist/lockdown.umd.js (as well as lockdown.mjs, lockdown.cjs, ses.mjs, and ses.umd.js).

What are the implications of doing this?

This removes the vendored `lib/lockdown.umd.js`.

`ses` does not actually export its `dist/lockdown.umd.js`.  It _does_ export `dist/ses.cjs` as `lockdown`. `dist/ses.cjs` is _identical_ to `dist/lockdown.umd.js` (as well as `lockdown.mjs`, `lockdown.cjs`, `ses.mjs`, and `ses.umd.js`).

What are the implications of doing this?
@boneskull boneskull requested review from legobeat and a team as code owners March 8, 2024 21:00
@github-actions github-actions bot added dependencies Pull requests that update a dependency file pkg:lavamoat-core Changes in package lavamoat-core labels Mar 8, 2024
@boneskull
Copy link
Contributor Author

boneskull commented Mar 8, 2024

OK, this is not so straightforward, because we're using the resolve package in lavamoat-browserify. resolve doesn't understand subpath exports--so the only way to be able to resolve ses/lockdown from lavamoat-browserify via aa would be to provide a different resolver--e.g., Node.js' builtin resolver.

I'm not sure it's worth doing this or not.

@legobeat
Copy link
Contributor

The alternative I had in mind would be to keep in the resulting dist/ but remove it from source-control, instead in the file from the devDependency on bundling.

@naugtur
Copy link
Member

naugtur commented Mar 12, 2024

Aditionally, when we resolve SES instead of reading it from a file, we open up more ways to hack the build in a way that dismantles the bundle runtime security.

@boneskull
Copy link
Contributor Author

@legobeat

The alternative I had in mind would be to keep in the resulting dist/ but remove it from source-control, instead in the file from the devDependency on bundling.

I don't follow

@naugtur

Aditionally, when we resolve SES instead of reading it from a file, we open up more ways to hack the build in a way that dismantles the bundle runtime security.

Yes. This is a tradeoff in that it it opens this hole, but closes another hole: currently, a consumer cannot easily override or otherwise provide a custom resolution for the version of ses consumed by lavamoat-core in order to mitigate a vulnerability in our bundled version of ses. The status quo requires action on our part; the alternative (as presented here) is to hand that responsibility to the consumer.

Of course, either way, a consumer can patch-package their way out of the problem, if needed.

I don't really understand which issue is more severe, or more likely. Hopefully someone else has better insight. 😄

@weizman
Copy link
Member

weizman commented Mar 19, 2024

I gave

Aditionally, when we resolve SES instead of reading it from a file, we open up more ways to hack the build in a way that dismantles the bundle runtime security.

some thought, because it's a great argument, but I think that eventually this statement is true to many other dependencies we rely on. Some set of deps (ideally as small as possible) is going to be a set we vet on, and I think SES needs to be one of them, given it's a project we contribute to and trust is secure.

Thus, maybe resolving it locally isn't the worst idea and it would be far better than having a checked in version of the entire file in terms of convenience.

We can also consider building a mechanizm that verifies the content of the SES we're about to use matches the public published version, but not as a blocker to this PR IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file pkg:lavamoat-core Changes in package lavamoat-core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants