Skip to content

runtime(tar): force wrapping on search()#19333

Open
KevinGoodsell wants to merge 1 commit intovim:masterfrom
KevinGoodsell:tar-wrapscan
Open

runtime(tar): force wrapping on search()#19333
KevinGoodsell wants to merge 1 commit intovim:masterfrom
KevinGoodsell:tar-wrapscan

Conversation

@KevinGoodsell
Copy link
Contributor

Problem: search() is used to check for the message from tar that indicates leading slashes found in the tar archive, or to check for the leading slashes themselves. However, if 'nowrapscan' is in effect these searches are limited to the last line and don't find any results. This causes the warning message from tar to be seen in the buffer, the "Path Traversal Attack Detected" message to be omitted, and editing actions can fail. This can be seen, for example, when editing src/testdir/samples/evil.tar.

Solution: Use the 'w' flag for search().

@KevinGoodsell KevinGoodsell marked this pull request as draft February 4, 2026 18:37
Problem: search() is used to check for the message from tar that
indicates leading slashes found in the tar archive, or to check for the
leading slashes themselves. However, if 'nowrapscan' is in effect these
searches are limited to the last line and don't find any results. This
causes the warning message from tar to be seen in the buffer, the "Path
Traversal Attack Detected" message to be omitted, and editing actions
can fail. This can be seen, for example, when editing
src/testdir/samples/evil.tar.

Solution: Use the 'w' flag for search().

Signed-off-by: Kevin Goodsell <kevin-opensource@omegacrash.net>
@KevinGoodsell KevinGoodsell marked this pull request as ready for review February 5, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant