Skip to content

Commit e241ea4

Browse files
AAP-49671 Fix GitHub enterprise authenticator encrypted fields (#773)
Fixes CVE-2025-7738
1 parent ef68972 commit e241ea4

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

ansible_base/authentication/authenticator_plugins/github_enterprise.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ class AuthenticatorPlugin(SocialAuthMixin, SocialAuthValidateCallbackMixin, Gith
1414
logger = logger
1515
type = "github-enterprise"
1616
category = "sso"
17-
configuration_encrypted_fields = ['ENTERPRISE_SECRET']
17+
configuration_encrypted_fields = ['SECRET']

ansible_base/authentication/authenticator_plugins/github_enterprise_org.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ class AuthenticatorPlugin(SocialAuthMixin, SocialAuthValidateCallbackMixin, Gith
1414
logger = logger
1515
type = "github-enterprise-org"
1616
category = "sso"
17-
configuration_encrypted_fields = ['ENTERPRISE_ORG_SECRET']
17+
configuration_encrypted_fields = ['SECRET']

test_app/tests/authentication/serializers/test_authenticator.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from rest_framework.serializers import ValidationError
77

88
from ansible_base.authentication.serializers import AuthenticatorSerializer
9+
from ansible_base.lib.utils.encryption import ENCRYPTED_STRING
910

1011

1112
def test_validate_blank_authenticator_slug(shut_up_logging):
@@ -39,6 +40,15 @@ def test_removed_authenticator_plugin(ldap_authenticator, shut_up_logging):
3940
assert item['configuration'] == {}
4041

4142

43+
@pytest.mark.django_db
44+
@pytest.mark.parametrize("fixture", ["github_enterprise_authenticator", "github_enterprise_organization_authenticator"])
45+
def test_authenticator_configuration_encrypted_fields(request, fixture, shut_up_logging):
46+
serializer = AuthenticatorSerializer()
47+
authenticator = request.getfixturevalue(fixture)
48+
item = serializer.to_representation(authenticator)
49+
assert item['configuration']["SECRET"] == ENCRYPTED_STRING
50+
51+
4252
def test_authenticator_no_configuration(shut_up_logging):
4353
serializer = AuthenticatorSerializer()
4454
with pytest.raises(ValidationError):

0 commit comments

Comments
 (0)