Skip to content

fix(deps): update module github.com/cyphar/filepath-securejoin to v0.4.1#2217

Merged
openshift-merge-bot[bot] merged 1 commit intomainfrom
renovate/github.com-cyphar-filepath-securejoin-0.x
Feb 14, 2025
Merged

fix(deps): update module github.com/cyphar/filepath-securejoin to v0.4.1#2217
openshift-merge-bot[bot] merged 1 commit intomainfrom
renovate/github.com-cyphar-filepath-securejoin-0.x

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Jan 21, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
github.com/cyphar/filepath-securejoin v0.3.6 -> v0.4.1 age adoption passing confidence

Release Notes

cyphar/filepath-securejoin (github.com/cyphar/filepath-securejoin)

v0.4.1

Compare Source

This release fixes a regression introduced in one of the hardening
features added to filepath-securejoin 0.4.0.

  • The restrictions added for root paths passed to SecureJoin in 0.4.0 was
    found to be too strict and caused some regressions when folks tried to
    update, so this restriction has been relaxed to only return an error if the
    path contains a .. component. We still recommend users use filepath.Clean
    (and even filepath.EvalSymlinks) on the root path they are using, but at
    least you will no longer be punished for "trivial" unclean paths. (#​46)

Signed-off-by: Aleksa Sarai cyphar@cyphar.com

v0.4.0

Compare Source

This release primarily includes a few minor breaking changes to make the
MkdirAll and SecureJoin interfaces more robust against accidental
misuse.

  • SecureJoin(VFS) will now return an error if the provided root is not a
    filepath.Clean'd path.

    While it is ultimately the responsibility of the caller to ensure the root is
    a safe path to use, passing a path like /symlink/.. as a root would result
    in the SecureJoin'd path being placed in / even though /symlink/..
    might be a different directory, and so we should more strongly discourage
    such usage.

    All major users of securejoin.SecureJoin already ensure that the paths they
    provide are safe (and this is ultimately a question of user error), but
    removing this foot-gun is probably a good idea. Of course, this is
    necessarily a breaking API change (though we expect no real users to be
    affected by it).

    Thanks to Erik Sjölund, who initially
    reported this issue as a possible security issue.

  • MkdirAll and MkdirHandle now take an os.FileMode-style mode argument
    instead of a raw unix.S_*-style mode argument, which may cause compile-time
    type errors depending on how you use filepath-securejoin. For most users,
    there will be no change in behaviour aside from the type change (as the
    bottom 0o777 bits are the same in both formats, and most users are probably
    only using those bits).

    However, if you were using unix.S_ISVTX to set the sticky bit with
    MkdirAll(Handle) you will need to switch to os.ModeSticky otherwise you
    will get a runtime error with this update. In addition, the error message you
    will get from passing unix.S_ISUID and unix.S_ISGID will be different as
    they are treated as invalid bits now (note that previously passing said bits
    was also an error).

Thanks to the following contributors for helping make this release
possible:

Signed-off-by: Aleksa Sarai cyphar@cyphar.com


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the dependencies Pull requests that update a dependency file label Jan 21, 2025
Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

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

DO NOT MERGE THIS until runc, and therefore Podman, can work with the updated filepath-securejoin.

Follow opencontainers/runc#4590 / containers/podman#25001 .

Compare #2216 .

@renovate renovate bot force-pushed the renovate/github.com-cyphar-filepath-securejoin-0.x branch 3 times, most recently from 1ef4b68 to 9f3c82f Compare January 27, 2025 20:34
@kolyshkin
Copy link
Contributor

Most probably a newer version (0.4.1?) will be released, relaxing the SecureJoin's root requirement (see cyphar/filepath-securejoin#47). Therefore, we can just skip 0.4.0.

@renovate renovate bot changed the title fix(deps): update module github.com/cyphar/filepath-securejoin to v0.4.0 fix(deps): update module github.com/cyphar/filepath-securejoin to v0.4.1 Jan 28, 2025
@renovate renovate bot force-pushed the renovate/github.com-cyphar-filepath-securejoin-0.x branch 4 times, most recently from 3b4ea2c to 89ff194 Compare January 30, 2025 21:49
@kolyshkin
Copy link
Contributor

Most probably a newer version (0.4.1?) will be released, relaxing the SecureJoin's root requirement (see cyphar/filepath-securejoin#47). Therefore, we can just skip 0.4.0.

This is now done, so the breaking change is no more.

Copy link
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

lgtm

@renovate renovate bot force-pushed the renovate/github.com-cyphar-filepath-securejoin-0.x branch from 89ff194 to d4fce61 Compare January 31, 2025 20:10
@mtrmac
Copy link
Collaborator

mtrmac commented Jan 31, 2025

This is now done, so the breaking change is no more.

For Podman (and therefore c/storage), the more immediate concern was the change to the securejoin.MkdirAllHandle API, which broke runc and forces Podman to update both in lockstep. (The restriction on .. might have been a concern, but Podman doesn’t get that far.)

So this c/storage PR should still wait until containers/podman#25001 succeeds.

@renovate renovate bot force-pushed the renovate/github.com-cyphar-filepath-securejoin-0.x branch 4 times, most recently from f4932c5 to 8883a04 Compare February 4, 2025 16:47
@nalind
Copy link
Member

nalind commented Feb 4, 2025

Well then
/hold

@renovate renovate bot force-pushed the renovate/github.com-cyphar-filepath-securejoin-0.x branch 6 times, most recently from 90e04fc to 57fa009 Compare February 11, 2025 14:38
@renovate renovate bot force-pushed the renovate/github.com-cyphar-filepath-securejoin-0.x branch from 57fa009 to 5a5ef67 Compare February 14, 2025 09:31
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@renovate renovate bot force-pushed the renovate/github.com-cyphar-filepath-securejoin-0.x branch from 5a5ef67 to 86975bc Compare February 14, 2025 16:40
@mtrmac
Copy link
Collaborator

mtrmac commented Feb 14, 2025

/unhold

Podman was updated in containers/podman#25319 .

Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 14, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kolyshkin, mtrmac, renovate[bot]

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit b6f6fb2 into main Feb 14, 2025
20 checks passed
@renovate renovate bot deleted the renovate/github.com-cyphar-filepath-securejoin-0.x branch February 14, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved dependencies Pull requests that update a dependency file lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants