<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE glsa SYSTEM "http://www.gentoo.org/dtd/glsa.dtd">
<glsa id="200410-16">
  <title>PostgreSQL: Insecure temporary file use in make_oidjoins_check</title>
  <synopsis>
    The make_oidjoins_check script, part of the PostgreSQL package, is
    vulnerable to symlink attacks, potentially allowing a local user to
    overwrite arbitrary files with the rights of the user running the utility.
  </synopsis>
  <product type="ebuild">PostgreSQL</product>
  <announced>2004-10-18</announced>
  <revised count="04">2009-05-28</revised>
  <bug>66371</bug>
  <access>local</access>
  <affected>
    <package name="dev-db/postgresql" auto="yes" arch="*">
      <unaffected range="ge">7.4.5-r2</unaffected>
      <unaffected range="rge">7.3.7-r2</unaffected>
      <unaffected range="rge">7.3.15</unaffected>
      <unaffected range="rge">7.3.16</unaffected>
      <unaffected range="rge">7.3.18</unaffected>
      <unaffected range="rge">7.3.21</unaffected>
      <vulnerable range="le">7.4.5-r1</vulnerable>
    </package>
  </affected>
  <background>
    <p>
    PostgreSQL is an open source database based on the POSTGRES database
    management system. It includes several contributed scripts including
    the make_oidjoins_check script.
    </p>
  </background>
  <description>
    <p>
    The make_oidjoins_check script insecurely creates temporary files in
    world-writeable directories with predictable names.
    </p>
  </description>
  <impact type="normal">
    <p>
    A local attacker could create symbolic links in the temporary files
    directory, pointing to a valid file somewhere on the filesystem. When
    make_oidjoins_check is called, this would result in file overwrite with
    the rights of the user running the utility, which could be the root
    user.
    </p>
  </impact>
  <workaround>
    <p>
    There is no known workaround at this time.
    </p>
  </workaround>
  <resolution>
    <p>
    All PostgreSQL users should upgrade to the latest version:
    </p>
    <code>
    # emerge sync
    
    # emerge -pv "&gt;=dev-db/postgresql-7.4.5-r2"
    # emerge "&gt;=dev-db/postgresql-7.4.5-r2"</code>
    <p>
    Upgrade notes: PostgreSQL 7.3.x users should upgrade to the latest
    available 7.3.x version to retain database compatibility.
    </p>
  </resolution>
  <references>
    <uri link="https://www.trustix.org/errata/2004/0050/">Trustix Advisory #2004-0050</uri>
    <uri link="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2004-0977">CVE-2004-0977</uri>
  </references>
  <metadata tag="submitter" timestamp="2004-10-18T13:31:59Z">
    koon
  </metadata>
  <metadata tag="bugReady" timestamp="2004-10-18T13:32:56Z">
    koon
  </metadata>
</glsa>
