Opened 4 years ago

Last modified 3 years ago

#21511 needs_information defect

State.tmp is not erased and it may contain sensitive information

Reported by: ric_sm Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords: temporary file delection tor-client needs-analysis
Cc: mcs Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


This is not a bug, but can improve the TOR browser.

The TorBrowser\Browser\TorBrowser\Data\Tor\state.tmp is not erased when TOR exits, in my tests it was not even erased after rebooting the computer.

Child Tickets

Change History (7)

comment:1 Changed 4 years ago by dgoulet

Component: ObfuscationApplications/Tor Browser
Owner: set to tbb-team

Hrm, this could be a Tor bug actually...

comment:2 Changed 4 years ago by teor

Component: Applications/Tor BrowserCore Tor/Tor
Milestone: Tor: unspecified
Owner: tbb-team deleted
Status: newassigned
Type: enhancementdefect

state.tmp is produced by tor.

Don't we unlink state.tmp after writing state?

comment:3 Changed 4 years ago by dgoulet

We do! So I'm guessing the Tor Browser here was closed abruptly leaving that file there.

comment:4 Changed 4 years ago by mcs

Is it really a problem that a state.tmp file is left behind? I assume it will be overwritten and removed the next time tor writes state?

comment:5 Changed 4 years ago by mcs

Cc: mcs added

comment:6 Changed 4 years ago by dgoulet

Status: assignedneeds_information

Yes we do...

    /* We always replace an existing temporary file if there is one. */
    open_flags |= O_CREAT|O_TRUNC;

So I think this can only be caused by clausing the Tor Browser abruptly at the exact time where the temp file existed but then it will get overwritten later on. The other possibility is that something went wrong with the rename() and then for some other reason the unlink() that we try to do on the temp file if the rename did fail. In that case, the log should have warnings.

@ric_sm, maybe you can open your Tor Browser in the console and look for those warnings?

comment:7 Changed 3 years ago by nickm

Keywords: temporary file delection tor-client needs-analysis added
Note: See TracTickets for help on using tickets.