<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>security: do not use sys_get_temp_dir()</title> 
  <pubDate>Mon, 06 Apr 2026 04:02:56 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/11756</link> 
  <atom:link rel="self" type="application/rss+xml" title="security: do not use sys_get_temp_dir()" href="https://bugs.horde.org/ticket/11756/rss" /> 
  <description>security: do not use sys_get_temp_dir()</description> 
 
   
   
  <item> 
   <title>Horde places files with hardcoded names (e.g. &#039;horde_cache_g</title> 
   <description>Horde places files with hardcoded names (e.g. &#039;horde_cache_gc&#039; or &#039;passwd.lock&#039;) into the directory returned by sys_get_temp_dir().  Unfortunately, this function is broken by returning always the world-writable /tmp directory and there is no way to change this (I am aware of modifying the TMPDIR environment variable, but this requires changes in the apache startup script affecting the whole apache server inclusive unrelated vhosts).

Having cache data in /tmp requires to add this directory to &#039;open_basedir&#039; which opens vectors for other security holes.

There are functional problems too when different vhosts with perhaps different horde versions are accessing the same /tmp/horde_cache_gc file.

You should replace all occurrences of sys_get_temp_dir() with a utility function which returns e.g.

| getenv(&#039;TMPDIR&#039;) ? getenv(&#039;TMPDIR&#039;) : sys_get_temp_dir()

So, TMPDIR can be configured per vhost/directory an the apache configuration.

</description> 
   <pubDate>Sun, 25 Nov 2012 21:58:38 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/11756#t75033</link> 
  </item> 
   
  <item> 
   <title>there is an upstream php report which is open for more than </title> 
   <description>there is an upstream php report which is open for more than 4 years: https://bugs.php.net/bug.php?id=44972

So, do not wait on PHP to fix this...</description> 
   <pubDate>Sun, 25 Nov 2012 22:01:33 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/11756#t75034</link> 
  </item> 
   
  <item> 
   <title>Configure the temp directory in horde&#039;s configuration.</title> 
   <description>Configure the temp directory in horde&#039;s configuration.</description> 
   <pubDate>Sun, 25 Nov 2012 22:44:05 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/11756#t75035</link> 
  </item> 
   
  <item> 
   <title>&gt; Configure the temp directory in horde&#039;s configuration.

</title> 
   <description>&gt; Configure the temp directory in horde&#039;s configuration.

How can it configured for cases like:

/usr/share/pear/Horde/Mime/Viewer/Ooo.php:            $tmpdir = Horde_Util::createTempDir(true);

----

    static public function createTempDir($delete = true, $temp_dir = null)
    {
        if (is_null($temp_dir)) {
            $temp_dir = sys_get_temp_dir();
        }
</description> 
   <pubDate>Mon, 26 Nov 2012 15:57:46 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/11756#t75085</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in Git (master):

commit f41dc10b1a23</title> 
   <description>Changes have been made in Git (master):

commit f41dc10b1a23e0f16e7aca04aa20b1df4d43b3f0
Author: Jan Schneider &lt;jan@horde.org&gt;
Date:   Mon Feb 1 17:31:07 2016 +0100

    Use configured temporary directory (Request #11756).

 .../Core/lib/Horde/Core/Factory/MimeViewer.php     |    1 +
 .../Mime_Viewer/lib/Horde/Mime/Viewer/Ooo.php      |    7 +++----
 framework/Mime_Viewer/package.xml                  |    2 ++
 3 files changed, 6 insertions(+), 4 deletions(-)

http://github.com/horde/horde/commit/f41dc10b1a23e0f16e7aca04aa20b1df4d43b3f0</description> 
   <pubDate>Mon, 01 Feb 2016 17:08:50 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/11756#t89801</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
