Skip to content
This repository has been archived by the owner. It is now read-only.

What is .tmp.node? What is the purpose? #12534

Closed
l9sk opened this issue Jan 6, 2018 · 7 comments
Closed

What is .tmp.node? What is the purpose? #12534

l9sk opened this issue Jan 6, 2018 · 7 comments
Labels

Comments

@l9sk
Copy link

@l9sk l9sk commented Jan 6, 2018

Everytime I start brave, these files always appears on my tmp folder, I open a few tab, it also appear another .tmp.node file.

I thought this file is cryptomining, but I realise this was create by brave. could someone explain?

@UFLrob
Copy link

@UFLrob UFLrob commented Apr 3, 2018

I second l9sk's questions.

What Brave feature and I disable to prevent Brave from needing the .tmp.node file? Many cannot use Brave in the Enterprise due to malware restrictions preventing an unsigned file (like .tmp.node) from being executed.

@bsclifton
Copy link
Member

@bsclifton bsclifton commented Apr 25, 2018

@l9sk @UFLrob do you have more information? What platform are you on? Where are you seeing this?

I'm definitely not aware of anything which would have this behavior

@bsclifton bsclifton added this to the Triage Backlog milestone Apr 25, 2018
@UFLrob
Copy link

@UFLrob UFLrob commented Apr 30, 2018

@sdkester
Copy link

@sdkester sdkester commented Jul 12, 2018

When you spawn a child process from a file within an asar container, Windows copies it to a temp folder to be executed because it can't run it from within the container.

In our case, the electron-builder smartUnpack function was detecting things like the ssh2 module and correctly putting it in /resources/app.asar.unpacked/, but not sqlite3. On each run, the executable file was copied out of the asar and put into %appdata%/Local/Temp as <guid>.tmp.node.

I suspect that it was undetected because the file extension was .node, not a more common executable like .exe or .dll.

In our case, adding "asarUnpack": "**\\*.node", to the electron-builder configuration adds the sqlite3 module to the unpacked folder and the temp file is no longer created on each run.

@UFLrob
Copy link

@UFLrob UFLrob commented Jul 13, 2018

@sdkester
Copy link

@sdkester sdkester commented Jul 13, 2018

@UFLrob I was sharing my discovery from our project with the Brave team to help them identify a possible cause in their project.

@bsclifton I've confirmed that in Windows 10 Pro v1803, Brave v0.23.31 is creating a temp file at %appdata%/Local/Temp as <guid>.tmp.node on each run.

The source of that temp file appears to be the file /app.asar/node_modules/leveldown/build/Release/leveldown.node. I think if you find that you exclude that file from the asar container via your electron-build settings, that this issue will be resolved.

@bsclifton bsclifton removed this from the Triage Backlog milestone Jul 26, 2018
@bsclifton
Copy link
Member

@bsclifton bsclifton commented Jul 26, 2018

Closing as it seems a good amount of investigation has been done (thanks!) and we now know why the temp file is being created. We use level/leveldown for Brave Payments

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants