D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6172 - rdmd: insecure temporary file creation
Summary: rdmd: insecure temporary file creation
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 critical
Assignee: Andrei Alexandrescu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-17 10:17 UTC by ari edelkind
Modified: 2015-06-09 05:15 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description ari edelkind 2011-06-17 10:17:34 UTC
rdmd will create temporary files in /tmp/.rdmd .  A malicious user could pre-create such a directory and link target files elsewhere.

A more appropriate location for temporary files would be under the user's home directory (e.g. $HOME/.rdmd).  If the user's home directory is unwritable, then /tmp/.rdmd.[random] may be used.
Comment 1 Gary Slopsema 2011-07-22 13:38:58 UTC
Not assigned to me, however a patch which appends a string of random numbers to /tmp/.rdmd can be found at

https://github.com/garslo/tools/commit/c19361441bf6546dfde2c450187c46856dd41965

with pull request

https://github.com/D-Programming-Language/tools/pull/4
Comment 2 Walter Bright 2012-04-28 01:44:45 UTC
This was pulled and incorporated some time ago.
Comment 3 ari edelkind 2012-04-28 05:37:04 UTC
Given that I reported this issue nearly a year ago, this isn't the sort of response time that I was hoping for with either a security report or a "critical" bug report.

For future reference, is there another avenue that I should use to report such issues for a more timely acknowledgement, or is this the sort of response time I should expect?
Comment 4 Andrei Alexandrescu 2012-04-28 08:26:45 UTC
If an issue stops from getting work done, it's always a good idea to substantiate the reason in the bug report. Also, starting a discussion on the topic at http://forum.dlang.org is helpful.

On the face of it this doesn't look like a showstopper. If the matter is absolutely essential, there are many possible workarounds, starting with changing rdmd.d and ending with simply using dmd instead of rdmd for critical work.