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

Enabling the ANR feature caused the debug main process function to become inoperative #904

Closed
3 tasks done
PayneFuRC opened this issue May 11, 2024 · 4 comments
Closed
3 tasks done
Assignees

Comments

@PayneFuRC
Copy link

PayneFuRC commented May 11, 2024

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Electron SDK Version

4.24.0

Electron Version

27.2.0

What platform are you using?

None

Link to Sentry event

No response

Steps to Reproduce

  1. enable sentry main process ANR detection
  2. kill -sigusr1 mainProcessID
  3. open chrome://inspect in chrome

Expected Result

There's a remote target
image

Actual Result

no remote target

@PayneFuRC
Copy link
Author

After enabling the Sentry ANR feature, it automatically activates the debugger, which listens on a local port. It is likely that this is the cause.

image

I have a question: With the debugger opened by default, if someone knows this port number, they could remotely control the app. Isn't that unsafe?"

@Lms24
Copy link
Member

Lms24 commented May 14, 2024

Hi @PayneFuRC thanks for writing in and apologies for the late reply! Unfortunately this seems to have slipped through since we've been busy with releasing version 8.0.0 of the JS SDKs.

@timfish would you mind taking a look at this when you have some time?

@timfish
Copy link
Collaborator

timfish commented May 14, 2024

With the debugger opened by default, if someone knows this port number, they could remotely control the app. Isn't that unsafe?

The ANR feature in the main process uses the Node debugger to detect event loop blocking from a worker thread. I'll add to the docs to make this more clear.

127.0.0.1 is the localhost port. This means it's only accessible from the local machine.

This does mean that software running on the local machine can potentially open a debug connection to your app. Depending on the nature of your app this may be a security concern. Note that unless you set Electron Fuses, your app can be started with --inspect to expose the debugger.

@PayneFuRC
Copy link
Author

ok, got it. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants