Skip to content

Weak path traversal check in docker/adapter.go RestoreVolumeSnapshot #239

@poyrazK

Description

@poyrazK

Why is this an issue?

In \internal/repositories/docker/adapter.go:583-586\\, same path traversal bypass issue as #238. The \strings.Contains(path, \"..\")\\ check is insufficient and can be bypassed with \..././../etc/passwd\\ pattern.

What is causing it?

Simple string matching for \..\\ does not catch encoded or multi-level traversal patterns.

How can it be solved?

Use \filepath.Clean(path) != path\\ or validate the resolved path starts with the expected directory.

Category

  • Small
  • Medium
  • Large

Severity

  • Low
  • Medium
  • High
  • Critical

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions