Skip to content

Commit 05f2dab

Browse files
authored
Fix: fail if KDC element has an invalid separation (#1044)
1 parent a3f2b36 commit 05f2dab

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

ospd_openvas/preferencehandler.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,12 +694,23 @@ def build_credentials_as_prefs(self, credentials: Dict) -> List[str]:
694694
"Missing realm for Kerberos authentication."
695695
)
696696
continue
697+
elif ';' in realm or '|' in realm:
698+
self.errors.append(
699+
"Invalid separator in realm for Kerberos "
700+
"authentication."
701+
)
702+
continue
697703
kdc = cred_params.get('kdc', '')
698704
if not kdc:
699705
self.errors.append(
700706
"Missing KDC for Kerberos authentication."
701707
)
702708
continue
709+
elif ';' in kdc or '|' in kdc:
710+
self.errors.append(
711+
"Invalid separator in KDC for Kerberos authentication."
712+
)
713+
continue
703714
cred_prefs_list.append(
704715
f'{OID_KRB5_AUTH}:1:entry:KRB5 login:|||{username}'
705716
)

0 commit comments

Comments
 (0)