Skip to content

Simulate mode: a relative symlink target with too many '..' resolves outside the changes chroot #68

Open

Description

@djbclark

In simulate mode a user-written relative symlink target with more .. components than the link's depth (for example ../../../../etc/x) resolves outside the changes chroot from <chroot>/<dir>/, while a real run clamps at /. ChrootSymlinkDeep() (changes_chroot.c:131-150) mirrors a relative target verbatim and has the same property; before #66 ToChangesChroot() concatenation (eval_context.c:4038) escaped in the same way. VerifyRelativeLink() never generates such a target; only a hand-written link_from does.

Pre-existing on upstream/master (5ac9805); found in the adversary review of #66. Matters only if simulate mode is meant to guarantee no writes outside the chroot when a later promise follows such a link. Also noted there: the computed link_type => "relative" variant of #28 (link in a subdirectory) is fixed by #66's one-line change but has no test.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions