Security
Headlines
HeadlinesLatestCVEs

Headline

CVE-2023-25152: server(filesystem): SafePath tweaks · pterodactyl/wings@dac9685

Wings is Pterodactyl’s server control plane. Affected versions are subject to a vulnerability which can be used to create new files and directory structures on the host system that previously did not exist, potentially allowing attackers to change their resource allocations, promote their containers to privileged mode, or potentially add ssh authorized keys to allow the attacker access to a remote shell on the target machine. In order to use this exploit, an attacker must have an existing “server” allocated and controlled by the Wings Daemon. This vulnerability has been resolved in version v1.11.3 of the Wings Daemon, and has been back-ported to the 1.7 release series in v1.7.3. Anyone running v1.11.x should upgrade to v1.11.3 and anyone running v1.7.x should upgrade to v1.7.3. There are no known workarounds for this vulnerability. ### Workarounds None at this time.

CVE
#vulnerability#mac#auth#ssh

@@ -2,6 +2,7 @@ package filesystem
import ( “context” iofs “io/fs” “os” “path/filepath” “strings” @@ -33,8 +34,6 @@ func (fs *Filesystem) IsIgnored(paths …string) error { // This logic is actually copied over from the SFTP server code. Ideally that eventually // either gets ported into this application, or is able to make use of this package. func (fs *Filesystem) SafePath(p string) (string, error) { var nonExistentPathResolution string
// Start with a cleaned up path before checking the more complex bits. r := fs.unsafeFilePath§
@@ -44,47 +43,24 @@ func (fs *Filesystem) SafePath(p string) (string, error) { if err != nil && !os.IsNotExist(err) { return "", errors.Wrap(err, “server/filesystem: failed to evaluate symlink”) } else if os.IsNotExist(err) { // The requested directory doesn’t exist, so at this point we need to iterate up the // path chain until we hit a directory that _does_ exist and can be validated. parts := strings.Split(filepath.Dir®, “/”)
var try string // Range over all of the path parts and form directory pathings from the end // moving up until we have a valid resolution or we run out of paths to try. for k := range parts { try = strings.Join(parts[:(len(parts)-k)], “/”)
if !fs.unsafeIsInDataDirectory(try) { break }
t, err := filepath.EvalSymlinks(try) if err == nil { nonExistentPathResolution = t break } } }
// If the new path doesn’t start with their root directory there is clearly an escape // attempt going on, and we should NOT resolve this path for them. if nonExistentPathResolution != “” { if !fs.unsafeIsInDataDirectory(nonExistentPathResolution) { return "", NewBadPathResolution(p, nonExistentPathResolution) // The target of one of the symlinks (EvalSymlinks is recursive) does not exist. // So we get what target path does not exist and check if it’s within the data // directory. If it is, we return the original path, otherwise we return an error. pErr, ok := err.(*iofs.PathError) if !ok { return "", errors.Wrap(err, “server/filesystem: failed to evaluate symlink”) }
// If the nonExistentPathResolution variable is not empty then the initial path requested // did not exist and we looped through the pathway until we found a match. At this point // we’ve confirmed the first matched pathway exists in the root server directory, so we // can go ahead and just return the path that was requested initially. return r, nil ep = pErr.Path }
// If the requested directory from EvalSymlinks begins with the server root directory go // ahead and return it. If not we’ll return an error which will block any further action // on the file. if fs.unsafeIsInDataDirectory(ep) { return ep, nil // Returning the original path here instead of the resolved path ensures that // whatever the user is trying to do will work as expected. If we returned the // resolved path, the user would be unable to know that it is in fact a symlink. return r, nil }
return "", NewBadPathResolution(p, r)

Related news

Ubuntu Security Notice USN-5972-1

Ubuntu Security Notice 5972-1 - Multiple security issues were discovered in Thunderbird. If a user were tricked into opening a specially crafted website in a browsing context, an attacker could potentially exploit these to cause a denial of service, obtain sensitive information, bypass security restrictions, cross-site tracing, or execute arbitrary code. Lukas Bernhard discovered that Thunderbird did not properly manage memory when invalidating JIT code while following an iterator. An attacker could potentially exploits this issue to cause a denial of service.

GHSA-p8r3-83r8-jwj5: Pterodactyl Wings contains UNIX Symbolic Link (Symlink) Following

### Impact This vulnerability impacts anyone running the affected versions of Wings. The vulnerability can be used to create new files and directory structures on the host system that previously did not exist, potentially allowing attackers to change their resource allocations, promote their containers to privileged mode, or potentially add ssh authorized keys to allow the attacker access to a remote shell on the target machine. In order to use this exploit, an attacker must have an existing "server" allocated and controlled by the Wings Daemon. Information on how the exploitation of this vulnerability works will be released on February 14, 2023 in North America. ### Patches This vulnerability has been resolved in version `v1.11.3` of the Wings Daemon, and has been back-ported to the 1.7 release series in `v1.7.3`. Anyone running `v1.11.x` should upgrade to `v1.11.3` and anyone running `v1.7.x` should upgrade to `v1.7.3` ### Workarounds None at this time.

CVE: Latest News

CVE-2023-50976: Transactions API Authorization by oleiman · Pull Request #14969 · redpanda-data/redpanda
CVE-2023-6905
CVE-2023-6903
CVE-2023-6904
CVE-2023-3907