Skip to content

Conversation

@compnerd
Copy link
Member

The contents of a symlink is the path to which it points. We can simply read the contents as a new path, and use getEntry to get the contents of the symbolic link. This implementation should also fully traverse any path that is a series of symbolic link. This does allow for a DoS attack by creating a recursive symbolic link cycle (e.g. a -> b -> a).

Fixes: #7081

The contents of a symlink is the path to which it points.  We can simply
read the contents as a new path, and use `getEntry` to get the contents
of the symbolic link.  This implementation should also fully traverse
any path that is a series of symbolic link.  This does allow for a DoS
attack by creating a recursive symbolic link cycle (e.g.
`a` -> `b` -> `a`).

Fixes: swiftlang#7081
@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd
Copy link
Member Author

@swift-ci please test

Copy link
Contributor

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

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

Thanks!

@MaxDesiatov
Copy link
Contributor

@swift-ci test windows

@compnerd compnerd merged commit 786c513 into swiftlang:main Nov 14, 2023
@compnerd compnerd deleted the symlink branch November 14, 2023 20:39
case .blob:
return try self.repository.readBlob(hash: hash)
default:
fatalError()
Copy link
Contributor

@tomerd tomerd Nov 14, 2023

Choose a reason for hiding this comment

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

we should avoid using fatalError which would crash the program. see #7096

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Internal error. Please file a bug at https://github.com/apple/swift-package-manager/issues with this info. symlinks not supported

3 participants