github-advanced-security[bot] commented on code in PR #3316:
URL: https://github.com/apache/cxf/pull/3316#discussion_r3604337425
##########
rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java:
##########
@@ -161,26 +161,29 @@
}
protected void checkCertificateBinding(Client client, TLSSessionInfo
tlsSessionInfo) {
- String subjectDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_SUBJECT_DN);
- if (subjectDn == null &&
client.getApplicationCertificates().isEmpty()) {
- LOG.warning("Client \"" + client.getClientId() + "\" can not be
bound to the TLS certificate");
- reportInvalidClient();
- }
X509Certificate cert =
OAuthUtils.getRootTLSCertificate(tlsSessionInfo);
-
- if (subjectDn != null
- &&
!subjectDn.equals(OAuthUtils.getSubjectDnFromTLSCertificates(cert))) {
- LOG.warning("Client \"" + client.getClientId() + "\" can not be
bound to the TLS certificate");
- reportInvalidClient();
- }
- String issuerDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_ISSUER_DN);
- if (issuerDn != null
- &&
!issuerDn.equals(OAuthUtils.getIssuerDnFromTLSCertificates(cert))) {
- LOG.warning("Client \"" + client.getClientId() + "\" can not be
bound to the TLS certificate");
- reportInvalidClient();
- }
if (!client.getApplicationCertificates().isEmpty()) {
compareTlsCertificates(tlsSessionInfo,
client.getApplicationCertificates());
+ } else {
+ String subjectDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_SUBJECT_DN);
+ String issuerDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_ISSUER_DN);
+ if (subjectDn == null && issuerDn == null) {
+ LOG.warning("Client \"" + client.getClientId()
+ + "\" can not be bound to the TLS certificate");
+ reportInvalidClient();
+ }
+ if (subjectDn != null
+ &&
!subjectDn.equals(OAuthUtils.getSubjectDnFromTLSCertificates(cert))) {
+ LOG.warning("Client \"" + client.getClientId()
+ + "\" can not be bound to the TLS certificate");
+ reportInvalidClient();
+ }
+ if (issuerDn != null
+ &&
!issuerDn.equals(OAuthUtils.getIssuerDnFromTLSCertificates(cert))) {
+ LOG.warning("Client \"" + client.getClientId()
+ + "\" can not be bound to the TLS certificate");
Review Comment:
## CodeQL / Insertion of sensitive information into log files
This [potentially sensitive information](1) is written to a log file.
This [potentially sensitive information](2) is written to a log file.
[Show more
details](https://github.com/apache/cxf/security/code-scanning/2246)
##########
rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java:
##########
@@ -161,26 +161,29 @@
}
protected void checkCertificateBinding(Client client, TLSSessionInfo
tlsSessionInfo) {
- String subjectDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_SUBJECT_DN);
- if (subjectDn == null &&
client.getApplicationCertificates().isEmpty()) {
- LOG.warning("Client \"" + client.getClientId() + "\" can not be
bound to the TLS certificate");
- reportInvalidClient();
- }
X509Certificate cert =
OAuthUtils.getRootTLSCertificate(tlsSessionInfo);
-
- if (subjectDn != null
- &&
!subjectDn.equals(OAuthUtils.getSubjectDnFromTLSCertificates(cert))) {
- LOG.warning("Client \"" + client.getClientId() + "\" can not be
bound to the TLS certificate");
- reportInvalidClient();
- }
- String issuerDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_ISSUER_DN);
- if (issuerDn != null
- &&
!issuerDn.equals(OAuthUtils.getIssuerDnFromTLSCertificates(cert))) {
- LOG.warning("Client \"" + client.getClientId() + "\" can not be
bound to the TLS certificate");
- reportInvalidClient();
- }
if (!client.getApplicationCertificates().isEmpty()) {
compareTlsCertificates(tlsSessionInfo,
client.getApplicationCertificates());
+ } else {
+ String subjectDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_SUBJECT_DN);
+ String issuerDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_ISSUER_DN);
+ if (subjectDn == null && issuerDn == null) {
+ LOG.warning("Client \"" + client.getClientId()
+ + "\" can not be bound to the TLS certificate");
+ reportInvalidClient();
+ }
+ if (subjectDn != null
+ &&
!subjectDn.equals(OAuthUtils.getSubjectDnFromTLSCertificates(cert))) {
+ LOG.warning("Client \"" + client.getClientId()
+ + "\" can not be bound to the TLS certificate");
Review Comment:
## CodeQL / Insertion of sensitive information into log files
This [potentially sensitive information](1) is written to a log file.
This [potentially sensitive information](2) is written to a log file.
[Show more
details](https://github.com/apache/cxf/security/code-scanning/2245)
##########
rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java:
##########
@@ -161,26 +161,29 @@
}
protected void checkCertificateBinding(Client client, TLSSessionInfo
tlsSessionInfo) {
- String subjectDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_SUBJECT_DN);
- if (subjectDn == null &&
client.getApplicationCertificates().isEmpty()) {
- LOG.warning("Client \"" + client.getClientId() + "\" can not be
bound to the TLS certificate");
- reportInvalidClient();
- }
X509Certificate cert =
OAuthUtils.getRootTLSCertificate(tlsSessionInfo);
-
- if (subjectDn != null
- &&
!subjectDn.equals(OAuthUtils.getSubjectDnFromTLSCertificates(cert))) {
- LOG.warning("Client \"" + client.getClientId() + "\" can not be
bound to the TLS certificate");
- reportInvalidClient();
- }
- String issuerDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_ISSUER_DN);
- if (issuerDn != null
- &&
!issuerDn.equals(OAuthUtils.getIssuerDnFromTLSCertificates(cert))) {
- LOG.warning("Client \"" + client.getClientId() + "\" can not be
bound to the TLS certificate");
- reportInvalidClient();
- }
if (!client.getApplicationCertificates().isEmpty()) {
compareTlsCertificates(tlsSessionInfo,
client.getApplicationCertificates());
+ } else {
+ String subjectDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_SUBJECT_DN);
+ String issuerDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_ISSUER_DN);
+ if (subjectDn == null && issuerDn == null) {
+ LOG.warning("Client \"" + client.getClientId()
+ + "\" can not be bound to the TLS certificate");
+ reportInvalidClient();
+ }
+ if (subjectDn != null
+ &&
!subjectDn.equals(OAuthUtils.getSubjectDnFromTLSCertificates(cert))) {
+ LOG.warning("Client \"" + client.getClientId()
+ + "\" can not be bound to the TLS certificate");
Review Comment:
## CodeQL / Log Injection
This log entry depends on a [user-provided value](1).
This log entry depends on a [user-provided value](2).
This log entry depends on a [user-provided value](3).
[Show more
details](https://github.com/apache/cxf/security/code-scanning/2248)
##########
rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java:
##########
@@ -161,26 +161,29 @@
}
protected void checkCertificateBinding(Client client, TLSSessionInfo
tlsSessionInfo) {
- String subjectDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_SUBJECT_DN);
- if (subjectDn == null &&
client.getApplicationCertificates().isEmpty()) {
- LOG.warning("Client \"" + client.getClientId() + "\" can not be
bound to the TLS certificate");
- reportInvalidClient();
- }
X509Certificate cert =
OAuthUtils.getRootTLSCertificate(tlsSessionInfo);
-
- if (subjectDn != null
- &&
!subjectDn.equals(OAuthUtils.getSubjectDnFromTLSCertificates(cert))) {
- LOG.warning("Client \"" + client.getClientId() + "\" can not be
bound to the TLS certificate");
- reportInvalidClient();
- }
- String issuerDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_ISSUER_DN);
- if (issuerDn != null
- &&
!issuerDn.equals(OAuthUtils.getIssuerDnFromTLSCertificates(cert))) {
- LOG.warning("Client \"" + client.getClientId() + "\" can not be
bound to the TLS certificate");
- reportInvalidClient();
- }
if (!client.getApplicationCertificates().isEmpty()) {
compareTlsCertificates(tlsSessionInfo,
client.getApplicationCertificates());
+ } else {
+ String subjectDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_SUBJECT_DN);
+ String issuerDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_ISSUER_DN);
+ if (subjectDn == null && issuerDn == null) {
+ LOG.warning("Client \"" + client.getClientId()
+ + "\" can not be bound to the TLS certificate");
Review Comment:
## CodeQL / Insertion of sensitive information into log files
This [potentially sensitive information](1) is written to a log file.
This [potentially sensitive information](2) is written to a log file.
[Show more
details](https://github.com/apache/cxf/security/code-scanning/2244)
##########
rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java:
##########
@@ -161,26 +161,29 @@
}
protected void checkCertificateBinding(Client client, TLSSessionInfo
tlsSessionInfo) {
- String subjectDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_SUBJECT_DN);
- if (subjectDn == null &&
client.getApplicationCertificates().isEmpty()) {
- LOG.warning("Client \"" + client.getClientId() + "\" can not be
bound to the TLS certificate");
- reportInvalidClient();
- }
X509Certificate cert =
OAuthUtils.getRootTLSCertificate(tlsSessionInfo);
-
- if (subjectDn != null
- &&
!subjectDn.equals(OAuthUtils.getSubjectDnFromTLSCertificates(cert))) {
- LOG.warning("Client \"" + client.getClientId() + "\" can not be
bound to the TLS certificate");
- reportInvalidClient();
- }
- String issuerDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_ISSUER_DN);
- if (issuerDn != null
- &&
!issuerDn.equals(OAuthUtils.getIssuerDnFromTLSCertificates(cert))) {
- LOG.warning("Client \"" + client.getClientId() + "\" can not be
bound to the TLS certificate");
- reportInvalidClient();
- }
if (!client.getApplicationCertificates().isEmpty()) {
compareTlsCertificates(tlsSessionInfo,
client.getApplicationCertificates());
+ } else {
+ String subjectDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_SUBJECT_DN);
+ String issuerDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_ISSUER_DN);
+ if (subjectDn == null && issuerDn == null) {
+ LOG.warning("Client \"" + client.getClientId()
+ + "\" can not be bound to the TLS certificate");
Review Comment:
## CodeQL / Log Injection
This log entry depends on a [user-provided value](1).
This log entry depends on a [user-provided value](2).
This log entry depends on a [user-provided value](3).
[Show more
details](https://github.com/apache/cxf/security/code-scanning/2247)
##########
rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java:
##########
@@ -161,26 +161,29 @@
}
protected void checkCertificateBinding(Client client, TLSSessionInfo
tlsSessionInfo) {
- String subjectDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_SUBJECT_DN);
- if (subjectDn == null &&
client.getApplicationCertificates().isEmpty()) {
- LOG.warning("Client \"" + client.getClientId() + "\" can not be
bound to the TLS certificate");
- reportInvalidClient();
- }
X509Certificate cert =
OAuthUtils.getRootTLSCertificate(tlsSessionInfo);
-
- if (subjectDn != null
- &&
!subjectDn.equals(OAuthUtils.getSubjectDnFromTLSCertificates(cert))) {
- LOG.warning("Client \"" + client.getClientId() + "\" can not be
bound to the TLS certificate");
- reportInvalidClient();
- }
- String issuerDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_ISSUER_DN);
- if (issuerDn != null
- &&
!issuerDn.equals(OAuthUtils.getIssuerDnFromTLSCertificates(cert))) {
- LOG.warning("Client \"" + client.getClientId() + "\" can not be
bound to the TLS certificate");
- reportInvalidClient();
- }
if (!client.getApplicationCertificates().isEmpty()) {
compareTlsCertificates(tlsSessionInfo,
client.getApplicationCertificates());
+ } else {
+ String subjectDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_SUBJECT_DN);
+ String issuerDn =
client.getProperties().get(OAuthConstants.TLS_CLIENT_AUTH_ISSUER_DN);
+ if (subjectDn == null && issuerDn == null) {
+ LOG.warning("Client \"" + client.getClientId()
+ + "\" can not be bound to the TLS certificate");
+ reportInvalidClient();
+ }
+ if (subjectDn != null
+ &&
!subjectDn.equals(OAuthUtils.getSubjectDnFromTLSCertificates(cert))) {
+ LOG.warning("Client \"" + client.getClientId()
+ + "\" can not be bound to the TLS certificate");
+ reportInvalidClient();
+ }
+ if (issuerDn != null
+ &&
!issuerDn.equals(OAuthUtils.getIssuerDnFromTLSCertificates(cert))) {
+ LOG.warning("Client \"" + client.getClientId()
+ + "\" can not be bound to the TLS certificate");
Review Comment:
## CodeQL / Log Injection
This log entry depends on a [user-provided value](1).
This log entry depends on a [user-provided value](2).
This log entry depends on a [user-provided value](3).
[Show more
details](https://github.com/apache/cxf/security/code-scanning/2249)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]