<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="/static/style.xsl" type="text/xsl"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title>Most recent entries from all</title>
    <link>https://db.gcve.eu</link>
    <description>Contains only the most 10 recent entries.</description>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>python-feedgen</generator>
    <language>en</language>
    <lastBuildDate>Fri, 02 Oct 2026 23:08:45 +0000</lastBuildDate>
    <item>
      <title>GHSA-9ppj-qmqm-q256 — node-tar Symlink Path Traversal via Drive-Relative Linkpath</title>
      <link>https://db.gcve.eu/vuln/ghsa-9ppj-qmqm-q256</link>
      <description>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; npm: tar&lt;/p&gt;
&lt;p&gt;### Summary
`tar` (npm) can be tricked into creating a symlink that points outside the extraction directory by using a drive-relative symlink target such as `C:../../../target.txt`, which enables file overwrite outside `cwd` during normal `tar.x()` extraction.&lt;/p&gt;
&lt;p&gt;### Details
The extraction logic in `Unpack[STRIPABSOLUTEPATH]` validates `..` segments against a resolved path that still uses the original drive-relative value, and only afterwards rewrites the stored `linkpath` to the stripped value.&lt;/p&gt;
&lt;p&gt;What happens with `linkpath: &amp;#34;C:../../../target.txt&amp;#34;`:
1. `stripAbsolutePath()` removes `C:` and rewrites the value to `../../../target.txt`.
2. The escape check resolves using the original pre-stripped value, so it is treated as in-bounds and accepted.
3. Symlink creation uses the rewritten value (`../../../target.txt`) from nested path `a/b/l`.
4. Writing through the extracted symlink overwrites the outside file (`../target.txt`).&lt;/p&gt;
&lt;p&gt;This is reachable in standard usage (`tar.x({ cwd, file })`) when extracting attacker-controlled tar archives.&lt;/p&gt;
&lt;p&gt;### PoC
Tested on Arch Linux with `tar@7.5.10`.&lt;/p&gt;
&lt;p&gt;PoC script (`poc.cjs`):&lt;/p&gt;
&lt;p&gt;```js
const fs = require(&amp;#39;fs&amp;#39;)
const path = require(&amp;#39;path&amp;#39;)
const { Header, x } = require(&amp;#39;tar&amp;#39;)&lt;/p&gt;
&lt;p&gt;const cwd = process.cwd()
const target = path.resolve(cwd, &amp;#39;..&amp;#39;, &amp;#39;target.txt&amp;#39;)
const tarFile = path.join(cwd, &amp;#39;poc.tar&amp;#39;)&lt;/p&gt;
&lt;p&gt;fs.writeFileSync(target, &amp;#39;ORIGINAL\n&amp;#39;)&lt;/p&gt;
&lt;p&gt;const b = Buffer.alloc(1536)
new Header({
  path: &amp;#39;a/b/l&amp;#39;,
  type: &amp;#39;SymbolicLink&amp;#39;,
  linkpath: &amp;#39;C:../../../target.t…&lt;/p&gt;</description>
      <content:encoded>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; npm: tar&lt;/p&gt;
&lt;p&gt;### Summary
`tar` (npm) can be tricked into creating a symlink that points outside the extraction directory by using a drive-relative symlink target such as `C:../../../target.txt`, which enables file overwrite outside `cwd` during normal `tar.x()` extraction.&lt;/p&gt;
&lt;p&gt;### Details
The extraction logic in `Unpack[STRIPABSOLUTEPATH]` validates `..` segments against a resolved path that still uses the original drive-relative value, and only afterwards rewrites the stored `linkpath` to the stripped value.&lt;/p&gt;
&lt;p&gt;What happens with `linkpath: &amp;#34;C:../../../target.txt&amp;#34;`:
1. `stripAbsolutePath()` removes `C:` and rewrites the value to `../../../target.txt`.
2. The escape check resolves using the original pre-stripped value, so it is treated as in-bounds and accepted.
3. Symlink creation uses the rewritten value (`../../../target.txt`) from nested path `a/b/l`.
4. Writing through the extracted symlink overwrites the outside file (`../target.txt`).&lt;/p&gt;
&lt;p&gt;This is reachable in standard usage (`tar.x({ cwd, file })`) when extracting attacker-controlled tar archives.&lt;/p&gt;
&lt;p&gt;### PoC
Tested on Arch Linux with `tar@7.5.10`.&lt;/p&gt;
&lt;p&gt;PoC script (`poc.cjs`):&lt;/p&gt;
&lt;p&gt;```js
const fs = require(&amp;#39;fs&amp;#39;)
const path = require(&amp;#39;path&amp;#39;)
const { Header, x } = require(&amp;#39;tar&amp;#39;)&lt;/p&gt;
&lt;p&gt;const cwd = process.cwd()
const target = path.resolve(cwd, &amp;#39;..&amp;#39;, &amp;#39;target.txt&amp;#39;)
const tarFile = path.join(cwd, &amp;#39;poc.tar&amp;#39;)&lt;/p&gt;
&lt;p&gt;fs.writeFileSync(target, &amp;#39;ORIGINAL\n&amp;#39;)&lt;/p&gt;
&lt;p&gt;const b = Buffer.alloc(1536)
new Header({
  path: &amp;#39;a/b/l&amp;#39;,
  type: &amp;#39;SymbolicLink&amp;#39;,
  linkpath: &amp;#39;C:../../../target.t…&lt;/p&gt;</content:encoded>
      <guid isPermaLink="false">https://db.gcve.eu/vuln/ghsa-9ppj-qmqm-q256</guid>
    </item>
  </channel>
</rss>
