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

Recursive fastbootDependencies not discovered #188

Open
ef4 opened this issue May 7, 2016 · 5 comments
Open

Recursive fastbootDependencies not discovered #188

ef4 opened this issue May 7, 2016 · 5 comments
Labels

Comments

@ef4
Copy link
Contributor

ef4 commented May 7, 2016

It does not appear possible to use (for example) ember-network in an addon, because its fastbootDependencies configuration is not discovered by the top-level consuming application.

As a workaround you can add the appropriate fastbootDependencies and dependencies at the top level.

@rwjblue
Copy link
Member

rwjblue commented May 7, 2016

You could argue that from a security perspective have some explicit opt-in in he consuming app is good, but having to dig around in all your deps and manually roll things up definitely doesn't feel like a great solution.

One possible avenue to satisfy both concerns would be to require the addon that is being consumed in fastbootDeps and to recurse from there.

@ef4
Copy link
Contributor Author

ef4 commented May 7, 2016

My understanding is that fastbootDependencies exists not to protect against addon authors, but to minimize the amount of code accessible inside the fastboot VM that could be used by somebody who finds an XSS (which becomes server RCE in fastboot).

Addon authors can run arbitrary code during the build step and monkey patch whatever they want, bypassing fastbotDependencies.

@tomdale
Copy link
Contributor

tomdale commented May 11, 2016

@ef4 Yes, I'd like to find time to revisit the entire system. I think it may be possible to track the call site that require() is coming from and do something smart. So for example, if we can tell that a call to FastBoot.require() is coming from liquid-fire/lib/some-file.js, we would know to use the Liquid Fire whitelist. This makes things more robust and more secure, since instead of a global whitelist, you'd have a per-package one.

@kratiahuja
Copy link
Contributor

I think we may not even need to have fastbootDependencies or whitelisting may not be needed with the new updateFastBootManifest hook that ember-cli-fastboot exposes.

@nickschot
Copy link

I just ran into this issue. Is there a preferred way to solve or work around this?

xg-wang pushed a commit to xg-wang/ember-cli-fastboot that referenced this issue Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants