[JBoss JIRA] (WFLY-7950) Coverity static analysis: Non-Serializable SecurityIdentity is contained in Serializable ElytronAccount
by Martin Choma (JIRA)
[ https://issues.jboss.org/browse/WFLY-7950?page=com.atlassian.jira.plugin.... ]
Martin Choma updated WFLY-7950:
-------------------------------
Description:
Coverity static analysis found Serializable ElytronAccount contains non-Serializable SecurityIdentity.
https://scan7.coverity.com/reports.htm#v23632/p12664/fileInstanceId=86223...
Please resolve this inconsistent situation.
By dev feedback SecurityIdentity can't be made Serializable. Rework to remove SecurityIdentity from ElytronAccount was suggested.
{code:title=hipchat.log}
[3:23 PM] Martin Choma: Shouldn't be SecurityIdentity Serializable? - because of HttpSession replication?
[3:23 PM] Darran Lofthouse: No it can't be
[3:24 PM] Darran Lofthouse: it is backed by implementation as well as state
[3:25 PM] David M. Lloyd: right it would essentially be a security hole to be able to deserialize an identity
[3:26 PM] David M. Lloyd: among other problems
[3:26 PM] Darran Lofthouse: on the far side we restore the identity instead of deserializing it
[3:31 PM] Martin Choma: I got it. Thing is static analyzer is complaining elytron-web ElytronAccount (Serializable class) is referencing SecurityIdentity, but probably problem is ElytronAccount does not have to be mark as Serializable, right?
[3:34 PM] Darran Lofthouse: @MartinChoma we may be able to re-work that and remove the reference to SI
{code}
was:
Coverity static analysis found Serializable ElytronAccount contains non-Serializable SecurityIdentity.
https://scan7.coverity.com/reports.htm#v23632/p12664/fileInstanceId=84867...
Please resolve this inconsistent situation.
By dev feedback SecurityIdentity can't be made Serializable. Rework to remove SecurityIdentity from ElytronAccount was suggested.
{code:title=hipchat.log}
[3:23 PM] Martin Choma: Shouldn't be SecurityIdentity Serializable? - because of HttpSession replication?
[3:23 PM] Darran Lofthouse: No it can't be
[3:24 PM] Darran Lofthouse: it is backed by implementation as well as state
[3:25 PM] David M. Lloyd: right it would essentially be a security hole to be able to deserialize an identity
[3:26 PM] David M. Lloyd: among other problems
[3:26 PM] Darran Lofthouse: on the far side we restore the identity instead of deserializing it
[3:31 PM] Martin Choma: I got it. Thing is static analyzer is complaining elytron-web ElytronAccount (Serializable class) is referencing SecurityIdentity, but probably problem is ElytronAccount does not have to be mark as Serializable, right?
[3:34 PM] Darran Lofthouse: @MartinChoma we may be able to re-work that and remove the reference to SI
{code}
> Coverity static analysis: Non-Serializable SecurityIdentity is contained in Serializable ElytronAccount
> -------------------------------------------------------------------------------------------------------
>
> Key: WFLY-7950
> URL: https://issues.jboss.org/browse/WFLY-7950
> Project: WildFly
> Issue Type: Bug
> Components: Security
> Affects Versions: 11.0.0.Alpha1
> Reporter: Martin Choma
> Assignee: Darran Lofthouse
>
> Coverity static analysis found Serializable ElytronAccount contains non-Serializable SecurityIdentity.
> https://scan7.coverity.com/reports.htm#v23632/p12664/fileInstanceId=86223...
> Please resolve this inconsistent situation.
> By dev feedback SecurityIdentity can't be made Serializable. Rework to remove SecurityIdentity from ElytronAccount was suggested.
> {code:title=hipchat.log}
> [3:23 PM] Martin Choma: Shouldn't be SecurityIdentity Serializable? - because of HttpSession replication?
> [3:23 PM] Darran Lofthouse: No it can't be
> [3:24 PM] Darran Lofthouse: it is backed by implementation as well as state
> [3:25 PM] David M. Lloyd: right it would essentially be a security hole to be able to deserialize an identity
> [3:26 PM] David M. Lloyd: among other problems
> [3:26 PM] Darran Lofthouse: on the far side we restore the identity instead of deserializing it
> [3:31 PM] Martin Choma: I got it. Thing is static analyzer is complaining elytron-web ElytronAccount (Serializable class) is referencing SecurityIdentity, but probably problem is ElytronAccount does not have to be mark as Serializable, right?
> [3:34 PM] Darran Lofthouse: @MartinChoma we may be able to re-work that and remove the reference to SI
> {code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
9 years, 3 months
[JBoss JIRA] (WFLY-7960) Coverity static analysis: Dereference null return value in KeyUtil (Elytron)
by Martin Choma (JIRA)
[ https://issues.jboss.org/browse/WFLY-7960?page=com.atlassian.jira.plugin.... ]
Martin Choma reassigned WFLY-7960:
----------------------------------
Assignee: Ilia Vassilev (was: Darran Lofthouse)
> Coverity static analysis: Dereference null return value in KeyUtil (Elytron)
> ----------------------------------------------------------------------------
>
> Key: WFLY-7960
> URL: https://issues.jboss.org/browse/WFLY-7960
> Project: WildFly
> Issue Type: Bug
> Components: Security
> Affects Versions: 11.0.0.Alpha1
> Reporter: Martin Choma
> Assignee: Ilia Vassilev
>
> Coverity static analysis found possible use of null object comming from {{RawPBEKey.getSalt()}} passed into {{javax.crypto.spec.PBEParameterSpec.PBEParameterSpec}}
> {code:java|title=javax.crypto.spec.PBEParameterSpec.java}
> public PBEParameterSpec(byte[] salt, int iterationCount) {
> this.salt = salt.clone();
> this.iterationCount = iterationCount;
> }
> {code}
> Responsible elytron code:
> {code:java|title=KeyUtils.java}
> if (key instanceof PBEKey && paramSpecClass.isAssignableFrom(PBEParameterSpec.class)) {
> final PBEKey pbeKey = (PBEKey) key;
> // TODO: we miss the IV here
> return paramSpecClass.cast(new PBEParameterSpec(pbeKey.getSalt(), pbeKey.getIterationCount()));
> }
> {code}
> https://scan7.coverity.com/reports.htm#v23632/p11778/fileInstanceId=84906...
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
9 years, 3 months
[JBoss JIRA] (WFLY-7960) Coverity static analysis: Dereference null return value in KeyUtil (Elytron)
by Martin Choma (JIRA)
[ https://issues.jboss.org/browse/WFLY-7960?page=com.atlassian.jira.plugin.... ]
Martin Choma updated WFLY-7960:
-------------------------------
Affects Version/s: 11.0.0.Alpha1
> Coverity static analysis: Dereference null return value in KeyUtil (Elytron)
> ----------------------------------------------------------------------------
>
> Key: WFLY-7960
> URL: https://issues.jboss.org/browse/WFLY-7960
> Project: WildFly
> Issue Type: Bug
> Components: Security
> Affects Versions: 11.0.0.Alpha1
> Reporter: Martin Choma
> Assignee: Ilia Vassilev
>
> Coverity static analysis found possible use of null object comming from {{RawPBEKey.getSalt()}} passed into {{javax.crypto.spec.PBEParameterSpec.PBEParameterSpec}}
> {code:java|title=javax.crypto.spec.PBEParameterSpec.java}
> public PBEParameterSpec(byte[] salt, int iterationCount) {
> this.salt = salt.clone();
> this.iterationCount = iterationCount;
> }
> {code}
> Responsible elytron code:
> {code:java|title=KeyUtils.java}
> if (key instanceof PBEKey && paramSpecClass.isAssignableFrom(PBEParameterSpec.class)) {
> final PBEKey pbeKey = (PBEKey) key;
> // TODO: we miss the IV here
> return paramSpecClass.cast(new PBEParameterSpec(pbeKey.getSalt(), pbeKey.getIterationCount()));
> }
> {code}
> https://scan7.coverity.com/reports.htm#v23632/p11778/fileInstanceId=84906...
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
9 years, 3 months
[JBoss JIRA] (WFLY-7960) Coverity static analysis: Dereference null return value in KeyUtil (Elytron)
by Martin Choma (JIRA)
Martin Choma created WFLY-7960:
----------------------------------
Summary: Coverity static analysis: Dereference null return value in KeyUtil (Elytron)
Key: WFLY-7960
URL: https://issues.jboss.org/browse/WFLY-7960
Project: WildFly
Issue Type: Bug
Components: Security
Reporter: Martin Choma
Assignee: Darran Lofthouse
Coverity static analysis found possible use of null object comming from {{RawPBEKey.getSalt()}} passed into {{javax.crypto.spec.PBEParameterSpec.PBEParameterSpec}}
{code:java|title=javax.crypto.spec.PBEParameterSpec.java}
public PBEParameterSpec(byte[] salt, int iterationCount) {
this.salt = salt.clone();
this.iterationCount = iterationCount;
}
{code}
Responsible elytron code:
{code:java|title=KeyUtils.java}
if (key instanceof PBEKey && paramSpecClass.isAssignableFrom(PBEParameterSpec.class)) {
final PBEKey pbeKey = (PBEKey) key;
// TODO: we miss the IV here
return paramSpecClass.cast(new PBEParameterSpec(pbeKey.getSalt(), pbeKey.getIterationCount()));
}
{code}
https://scan7.coverity.com/reports.htm#v23632/p11778/fileInstanceId=84906...
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
9 years, 3 months
[JBoss JIRA] (WFLY-7959) Coverity static analysis: DefaultSingleSignOn.getIdentity() not synchronized
by Martin Choma (JIRA)
Martin Choma created WFLY-7959:
----------------------------------
Summary: Coverity static analysis: DefaultSingleSignOn.getIdentity() not synchronized
Key: WFLY-7959
URL: https://issues.jboss.org/browse/WFLY-7959
Project: WildFly
Issue Type: Bug
Components: Security
Reporter: Martin Choma
Assignee: Darran Lofthouse
Priority: Minor
Coverity static-analysis scan found getter is not synchronized, while setter is.
{code}
public SecurityIdentity getIdentity() {
return this.entry.getCachedIdentity().getSecurityIdentity();
}
{code}
Current implementation is correct because in DefaultSingleSignOnEntry (currently only avalaible implementation of SingleSignOnEntry) cachedIdentity is volatile.
However other implementations can be wrongly implemented. Once getIdentity() would be marked with synchronize modifier, such problem shouldn't occure.
https://scan7.coverity.com/reports.htm#v23632/p11778/fileInstanceId=84908...
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
9 years, 3 months