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

improve error message for npm-based formatters to emphasize local-only #2107

Open
renannprado opened this issue May 4, 2024 · 3 comments
Open

Comments

@renannprado
Copy link

Hello dear maintainers,

I was setting up spotless in my project and while trying it out I started facing the below exception (which I already managed to fix).

I got a bit scared though, because it seems that it's trying to send my code to a remote server... is that correct?

I understand that you don't have control over all the plugins (i.e. I guess nothing would prevent prettier itself from doing this), but in this case here it seems that potential code leaking is coming from spotless itself.

If the answer to the above question is "yes", is it possible to optout of this altogether?

The below exception seems to be related to this class, but I can't make any conclusions just by looking at this class alone.

Thanks!

image
@nedtwigg nedtwigg changed the title Is my code (potentially) being sent somewhere else? Is my code (potentially) being sent somewhere else? [Answer: no] May 5, 2024
@nedtwigg
Copy link
Member

nedtwigg commented May 5, 2024

Spotless never sends your code to a remote server, and none of our plugins do.

We did have a problem once where one our formatters was doing XML validation, and full-spec XML validation did some network requests to get a DTD to validate against, and we filed a CVE for that when we realized it:

Some Spotless formatters are based on npm packages. And the way we interface with them is to open a little webserver on localhost, and do localhost requests to send data from the JVM to the Node.js process. That's what you're seeing.

If we ever find a plugin sending code to any network service, it is a red alarm fire, and would get a CVE just like we did with XML DTD mentioned earlier.

@nedtwigg nedtwigg closed this as completed May 5, 2024
@renannprado
Copy link
Author

@nedtwigg thanks for the reply! Since it's not clear from the error message, is it possible to improve this error somehow so that it doesn't scare other people in the future?

@nedtwigg nedtwigg changed the title Is my code (potentially) being sent somewhere else? [Answer: no] improve error message for npm-based formatters to emphasize local-only May 8, 2024
@nedtwigg
Copy link
Member

nedtwigg commented May 8, 2024

Good idea!

@nedtwigg nedtwigg reopened this May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants