GHSA-42r6-p4px-qvv6

Suggest an improvement
Source
https://github.com/advisories/GHSA-42r6-p4px-qvv6
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2023/06/GHSA-42r6-p4px-qvv6/GHSA-42r6-p4px-qvv6.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-42r6-p4px-qvv6
Aliases
Published
2023-06-12T20:30:27Z
Modified
2024-11-30T05:30:19.376666Z
Severity
  • 8.3 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H CVSS Calculator
Summary
tgstation-server cached user logins in legacy server
Details

Please note this advisory is for a historical preexisting issue in the legacy server from 2018. It has long since been triaged. It is being moved here for visibility. The text below is copied from the original issue #690

You can login to the server with any username/password combination if someone else is logged in

An explanation of the bug: Back in 3.2.1.0, in order to accommodate running the Control Panel using Mono some hooks were added to the WCF communication layer. Detailed in this commit: https://github.com/tgstation/tgstation-server/commit/2894ea03d708c7f16bab47ba5020c2ad4c3d5554#diff-0ba090ea7073a3a304dfdbdfc512f733

The bug was in this line: https://github.com/tgstation/tgstation-server/commit/2894ea03d708c7f16bab47ba5020c2ad4c3d5554#diff-0ba090ea7073a3a304dfdbdfc512f733R48 authPolicy is passed in by the framework but the documentation for what the parameter is is virtually non-existent: https://docs.microsoft.com/en-us/dotnet/api/system.servicemodel.serviceauthenticationmanager.authenticate?view=netframework-4.7.2#SystemServiceModelServiceAuthenticationManagerAuthenticateSystemCollectionsObjectModelReadOnlyCollectionSystemIdentityModelPolicyIAuthorizationPolicySystemUriSystemServiceModelChannelsMessage

Turns out it is a cache of what the previously returned policy was, as Floyd thankfully found out for us. The security patch fixes the issue by creating a new empty list as the return value when password authentication fails as opposed to using the authPolicy parameter.

If you're wondering why this line: https://github.com/tgstation/tgstation-server/commit/2894ea03d708c7f16bab47ba5020c2ad4c3d5554#diff-0ba090ea7073a3a304dfdbdfc512f733R42 didn't prevent the issue. It only invalidated the actual Windows login session, but in the eyes of the server the user was still valid since we just passed that closed handle as a return result. Had access to static files been attempted with a bad login, the request would end up erroring due to trying to impersonate using a closed user token handle.

This has been fixed in 1812a9c6793c8516c138a105ccfb2108164f0eff and versions 3.2.5.0+

Database specific
{
    "nvd_published_at": null,
    "cwe_ids": [],
    "severity": "HIGH",
    "github_reviewed": true,
    "github_reviewed_at": "2023-06-12T20:30:27Z"
}
References

Affected packages

NuGet / TGServiceInterface

Package

Name
TGServiceInterface
View open source insights on deps.dev
Purl
pkg:nuget/TGServiceInterface

Affected ranges

Type
ECOSYSTEM
Events
Introduced
3.2.1.0
Fixed
3.2.5.0

Affected versions

3.*

3.2.1
3.2.1.6
3.2.2
3.2.3.3
3.2.4

Database specific

{
    "last_known_affected_version_range": "<= 3.2.4.0"
}