backupengine: disallow path traversals via backup MANIFEST on restore#19470
Merged
timvaillancourt merged 2 commits intovitessio:mainfrom Feb 25, 2026
Merged
Conversation
…tore Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Contributor
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #19470 +/- ##
===========================================
- Coverage 69.67% 48.85% -20.82%
===========================================
Files 1614 46 -1568
Lines 216793 6988 -209805
===========================================
- Hits 151044 3414 -147630
+ Misses 65749 3574 -62175
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
@mattlord we can point this at the CVE you planned to create, or I can create an issue. For now the |
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
mhamza15
approved these changes
Feb 25, 2026
vitess-bot bot
added a commit
that referenced
this pull request
Feb 25, 2026
…tore (#19470) Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
vitess-bot bot
added a commit
that referenced
this pull request
Feb 25, 2026
…tore (#19470) Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
rvrangel
pushed a commit
to slackhq/vitess
that referenced
this pull request
Feb 26, 2026
…tore (vitessio#19470) Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
5 tasks
rvrangel
pushed a commit
to slackhq/vitess
that referenced
this pull request
Feb 26, 2026
…tore (vitessio#19470) Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
5 tasks
tanjinx
pushed a commit
to slackhq/vitess
that referenced
this pull request
Feb 27, 2026
…tore (vitessio#19470) (#805) Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> Co-authored-by: Tim Vaillancourt <tim@timvaillancourt.com>
tanjinx
pushed a commit
to slackhq/vitess
that referenced
this pull request
Mar 5, 2026
…MANIFEST` on restore (vitessio#19470) (#806) * `backupengine`: disallow path traversals via backup `MANIFEST` on restore (vitessio#19470) Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * Address dir traversal in file backup storage `.ListBackups(...)` (vitessio#18814) Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * fix for upstream cherry-pick --------- Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> Co-authored-by: Tim Vaillancourt <tim@timvaillancourt.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses a GHSA-8g8j-r87h-p36x where it is possible for an attacker with access to the backup storage to cause files to be restored outside of the intended backup path(s), via a directory traversal
How? In the backup
MANIFESTthere is aFileEntriesarray/list/slice representing files to restore. In this structure is aNamestring field we trust to be the place to restore the files. If a user adds../..s to these paths, the backup engine will trust this on restore and construct a path that traverses the intended base pathThis PR updates this code to validate that the paths we build from the
Namefield do not escape the parent/base directory they are meant to restore to. These 4 x base paths are known and on a typical install are:$VTDATAROOT/vt_0000000100/data$VTDATAROOT/vt_0000000100/innodb/data$VTDATAROOT/vt_0000000100/innodb/logs$VTDATAROOT/vt_0000000100/bin-logsRelated Issue(s)
GHSA-8g8j-r87h-p36x
Checklist
Deployment Notes
AI Disclosure
Claude w/Opus 4.6 wrote the tests and reviewed the changes I made