File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1067,7 +1067,8 @@ can be:
10671067
10681068* the string ``'tar' ``: Honor most *tar *-specific features (i.e. features of
10691069 UNIX-like filesystems), but block features that are very likely to be
1070- surprising or malicious. See :func: `tar_filter ` for details.
1070+ surprising or malicious. Note that this filter does not limit the targets of
1071+ symbolic links. See :func: `tar_filter ` for details.
10711072
10721073* the string ``'data' ``: Ignore or block most features specific to UNIX-like
10731074 filesystems. Intended for extracting cross-platform data archives.
@@ -1135,6 +1136,17 @@ reused in custom filters:
11351136
11361137 Return the modified ``TarInfo `` member.
11371138
1139+ .. warning ::
1140+ This filter does not check :attr: `TarInfo.linkname `. This means it does
1141+ not limit where a symbolic link member points. An absolute symbolic-link
1142+ target will remain absolute, and a relative target may resolve outside the
1143+ extraction destination. The destination path protection described above
1144+ concerns only where the archive member itself is written, not where a
1145+ symbolic link resolves. The stricter :func: `data_filter ` rejects these
1146+ unsafe link targets, raising :class: `~tarfile.AbsoluteLinkError ` for
1147+ absolute link targets or :class: `~tarfile.LinkOutsideDestinationError `
1148+ for link targets outside the destination.
1149+
11381150 .. versionchanged :: next
11391151
11401152 Filenames containing ``.. `` components are now normalized.
You can’t perform that action at this time.
0 commit comments