Skip to content

archive: add regression tests for tar path-traversal containment - #68

Merged
thaJeztah merged 1 commit into
moby:mainfrom
thaJeztah:add_regression_tests
Jul 22, 2026
Merged

archive: add regression tests for tar path-traversal containment#68
thaJeztah merged 1 commit into
moby:mainfrom
thaJeztah:add_regression_tests

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

Both tests fail against the previous (vulnerable) code and pass with the hardening in this branch:

  • TestUntarParentTraversalContained: entries named ".." / "../pwned" are rejected and never write into the destination's parent.
  • TestUntarSiblingPrefixContained: a hardlink whose target resolves to a sibling sharing the destination's path prefix (dest "base/dest", sibling "base/dest-evil") is rejected, rather than accepted by a string HasPrefix check.

Windows-specific coverage (":" / "" handling) needs Windows CI and remains a follow-up.

Copilot AI review requested due to automatic review settings July 22, 2026 12:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@thaJeztah
thaJeztah force-pushed the add_regression_tests branch from e134c03 to 5f5319e Compare July 22, 2026 16:35
Copilot AI review requested due to automatic review settings July 22, 2026 16:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@thaJeztah
thaJeztah force-pushed the add_regression_tests branch from 5f5319e to 6e7a78b Compare July 22, 2026 16:48
Copilot AI review requested due to automatic review settings July 22, 2026 16:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 22, 2026 16:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…pped)

Both tests fail against the previous (vulnerable) code and pass with the
hardening in this branch:

- TestUntarParentTraversalContained: entries named ".." / "../pwned" are
  rejected and never write into the destination's parent.
- TestUntarSiblingPrefixContained: a hardlink whose target resolves to a
  sibling sharing the destination's path prefix (dest "base/dest",
  sibling "base/dest-evil") is rejected, rather than accepted by a
  string HasPrefix check.

Windows-specific coverage (":" / "\" handling) needs Windows CI and
remains a follow-up.

Signed-off-by: Cesar Talledo <cesar.talledo@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
thaJeztah force-pushed the add_regression_tests branch from 956297c to 216738e Compare July 22, 2026 17:23
Copilot AI review requested due to automatic review settings July 22, 2026 17:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@thaJeztah
thaJeztah marked this pull request as ready for review July 22, 2026 17:23
@thaJeztah
thaJeztah merged commit 32b13f5 into moby:main Jul 22, 2026
12 checks passed
@thaJeztah
thaJeztah deleted the add_regression_tests branch July 22, 2026 19:32
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.81%. Comparing base (fcf3799) to head (216738e).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #68      +/-   ##
==========================================
- Coverage   65.96%   65.81%   -0.15%     
==========================================
  Files          42       42              
  Lines        2039     2039              
==========================================
- Hits         1345     1342       -3     
- Misses        517      519       +2     
- Partials      177      178       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants