Vulnerabilities

6 via 13 paths

Dependencies

36

Source

GitHub

Commit

master/a

Find, fix and prevent vulnerabilities in your code.

Severity
  • 2
  • 4
Status
  • 6
  • 0
  • 0

high severity

Denial of Service (DoS)

  • Vulnerable module: org.bitbucket.b_c:jose4j
  • Introduced through: org.aerogear:android-auth@2.0.0

Detailed paths

  • Introduced through: aerogear/android-showcase-template@aerogear/android-showcase-template#master/app org.aerogear:android-auth@2.0.0 org.bitbucket.b_c:jose4j@0.6.3

Overview

org.bitbucket.b_c:jose4j is a robust and easy to use open source implementation of JSON Web Token (JWT) and the JOSE specification suite (JWS, JWE, and JWK). It is written in Java and relies solely on the JCA APIs for cryptography. Please see https://bitbucket.org/b_c/jose4j/wiki/Home for more info, examples, etc...

Affected versions of this package are vulnerable to Denial of Service (DoS) via a large p2c (PBES2 Count) value. An attacker can cause the application to consume excessive CPU resources by supplying an unusually high PBES2 Count value.

PoC


import org.jose4j.jwa.AlgorithmConstraints;
import org.jose4j.jwe.ContentEncryptionAlgorithmIdentifiers;
import org.jose4j.jwe.JsonWebEncryption;
import org.jose4j.jwe.KeyManagementAlgorithmIdentifiers;
import org.jose4j.keys.AesKey;
import org.jose4j.lang.ByteUtil;

import java.security.Key;

public class jwt {
    public static void main(String[] argc)throws Exception{
        Key key = new AesKey(ByteUtil.randomBytes(16));
        JsonWebEncryption jwe = new JsonWebEncryption();
        jwe.setAlgorithmConstraints(new AlgorithmConstraints(AlgorithmConstraints.ConstraintType.PERMIT,
                KeyManagementAlgorithmIdentifiers.PBES2_HS256_A128KW));
        jwe.setContentEncryptionAlgorithmConstraints(new AlgorithmConstraints(AlgorithmConstraints.ConstraintType.PERMIT,
                ContentEncryptionAlgorithmIdentifiers.AES_128_CBC_HMAC_SHA_256));
        jwe.setKey(key);
        jwe.setCompactSerialization("eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwicDJjIjoyMDAwMDAwMDAwLCJwMnMiOiJ1RWxQUGhJLThGY2h3a1BhIn0=.JOIw8ccIdkor7-ZaHQz6pUkqj2VEL_XIuonOwdSrdeXxFb7qN8FZKw.1-ZgAG8KzCbl6wDjUzrsTw.0pLJ0ZEu9OMYV1jyfPIrqg.gFNkCEwB1lf_Jovc7ZOd5w");
        System.out.println("Payload: " + jwe.getPayload());
    }
}

Details

Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its intended and legitimate users.

Unlike other vulnerabilities, DoS attacks usually do not aim at breaching security. Rather, they are focused on making websites and services unavailable to genuine users resulting in downtime.

One popular Denial of Service vulnerability is DDoS (a Distributed Denial of Service), an attack that attempts to clog network pipes to the system by generating a large volume of traffic from many machines.

When it comes to open source libraries, DoS vulnerabilities allow attackers to trigger such a crash or crippling of the service by using a flaw either in the application code or from the use of open source libraries.

Two common types of DoS vulnerabilities:

  • High CPU/Memory Consumption- An attacker sending crafted requests that could cause the system to take a disproportionate amount of time to process. For example, commons-fileupload:commons-fileupload.

  • Crash - An attacker sending crafted requests that could cause the system to crash. For Example, npm ws package

Remediation

Upgrade org.bitbucket.b_c:jose4j to version 0.9.4 or higher.

References

high severity

Use of a Broken or Risky Cryptographic Algorithm

  • Vulnerable module: org.bitbucket.b_c:jose4j
  • Introduced through: org.aerogear:android-auth@2.0.0

Detailed paths

  • Introduced through: aerogear/android-showcase-template@aerogear/android-showcase-template#master/app org.aerogear:android-auth@2.0.0 org.bitbucket.b_c:jose4j@0.6.3

Overview

org.bitbucket.b_c:jose4j is a robust and easy to use open source implementation of JSON Web Token (JWT) and the JOSE specification suite (JWS, JWE, and JWK). It is written in Java and relies solely on the JCA APIs for cryptography. Please see https://bitbucket.org/b_c/jose4j/wiki/Home for more info, examples, etc...

Affected versions of this package are vulnerable to Use of a Broken or Risky Cryptographic Algorithm due to using RSA1_5 which is susceptible to chosen ciphertext attacks. The attack allows decrypting RSA1_5 or RSA_OAEP encrypted ciphertexts. It may be feasible to sign with the affected keys.

PoC

{
        "kty": "RSA",
        "alg": "RSA1_5",
        "use": "enc",
        "n": "w2A4cbwOAK4ATnwXkGWereqv9dkEcgAGHc9g-cjo1HFeilYirvfD2Un2vQxW_6g2OKRPmmo46vMZFMYv_V57174j411y-NQlZGb7iFqMQADzo60VZ7vpvAX_NuxNGxYR-N2cBgvgqDiGAoO9ouNdhuHhxipTjGVfrPUpxmJtNPZpxsgxQWSpYCYMl304DD_5wWrnumNNIKOaVsAYmjFPV_wqxFCHbitPd1BG9SwXPk7wAHtXT6rYaUImS_OKaHkTO1OO0PNhd3-wJRNMCh_EGUwAghfWgFyAd20pQLZamamxgHvfL4-0hwuzndhHt0ye-gRVTtXDFEwABB--zwvlCw",
        "e": "AQAB",
        "kid": "rsa1_5",
        "d": "EjMvbuDeyQ9sdeM3arscqgTXuWYq9Netui8sUHh3v_qDnQ1jE7t-4gny0y-IFy67RlGAHNlSTgixSG8h309i5_kNbMuyvx08EntJaS1OLVQpXhDskoo9vscsPBiNIj3PFMjIFQQcPG9vhGJzUu4tMzhtiME-oTB8VidMae-XTryPvozTu4rgfb4U7uauvLqESLz3A5xtzPnwNwqXAIlrdxU-MT_iln08on_QIF8afWUqCbsWWjEck_QDKLVpzh8VV9kkEVWwYfCFhHBwS-fgGJJTE3gK4HwOokydMtH95Dzj47MA2pLe600l7ioyGSPltcv967NtOpxMPM5ro751KQ",
        "p": "-F1u3NAMWPu1TIuvIywIjh5fuiA3AVKLgS6Fw_hAi3M9c3T7E1zNJZuHgQExJEu06ZPfzye9m7taDzh-Vw4VGDED_MZedsE2jEsWa9EKeq3bZVf5j81FLCHH8BicFqrPjvoVUC35wrl9SGJzaOa7KXxD2jW22umYjJS_kcopvf0",
        "q": "yWHG7jHqvfqT8gfhIlxpMbeJ02FrWIkgJC-zOJ26wXC6oxPeqhqEO7ulGqZPngNDdSGgWcQ7noGEU8O4MA9V3yhl91TFZy8unox0sGe0jDMwtxm3saXtTsjTE7FBxzcR0PubfyGiS0fJqQcj8oJSWzZPkUshzZ8rF3jTLc8UWac",
        "dp": "Va9WWhPkzqY4TCo8x_OfF_jeqcYHdAtYWb8FIzD4g6PEZZrMLEft9rWLsDQLEiyUQ6lio4NgZOPkFDA3Vi1jla8DYyfE20-ZVBlrqNK7vMtST8pkLPpyjOEyq2CyKRfQ99DLnZfe_RElad2dV2mS1KMsfZHeffPtT0LaPJ_0erk",
        "dq": "M8rA1cviun9yg0HBhgvMRiwU91dLu1Zw_L2D02DFgjCS35QhpQ_yyEYHPWZefZ4LQFmoms2cI7TdqolgmoOnKyCBsO2NY29AByjKbgAN8CzOL5kepEKvWJ7PonXpG-ou29eJ81VcHw5Ub_NVLG6V7b13E0AGbpKsC3pYnaRvcGs",
        "qi": "8zIqISvddJYC93hP0sKkdHuVd-Mes_gsbi8xqSFYGqc-wSU12KjzHnZmBuJl_VTGy9CO9W4K2gejr588a3Ozf9U5hx9qCVkV0_ttxHcTRem5sFPe9z-HkQE5IMW3SdmL1sEcvkzD7z8QhcHRpp5aMptfuwnxBPY8U449_iNgXd4"
      },

Remediation

Upgrade org.bitbucket.b_c:jose4j to version 0.9.3 or higher.

References

medium severity

Deserialization of Untrusted Data

  • Vulnerable module: com.google.code.gson:gson
  • Introduced through: com.google.code.gson:gson@2.8.4 and org.aerogear:android-push@2.0.0

Detailed paths

  • Introduced through: aerogear/android-showcase-template@aerogear/android-showcase-template#master/app com.google.code.gson:gson@2.8.4
    Remediation: Upgrade to com.google.code.gson:gson@2.8.9.
  • Introduced through: aerogear/android-showcase-template@aerogear/android-showcase-template#master/app org.aerogear:android-push@2.0.0 com.google.code.gson:gson@2.8.4

Overview

Affected versions of this package are vulnerable to Deserialization of Untrusted Data via the writeReplace() method in internal classes, which may allow a denial of service attack if combined with another exploit.

Details

Serialization is a process of converting an object into a sequence of bytes which can be persisted to a disk or database or can be sent through streams. The reverse process of creating object from sequence of bytes is called deserialization. Serialization is commonly used for communication (sharing objects between multiple hosts) and persistence (store the object state in a file or a database). It is an integral part of popular protocols like Remote Method Invocation (RMI), Java Management Extension (JMX), Java Messaging System (JMS), Action Message Format (AMF), Java Server Faces (JSF) ViewState, etc.

Deserialization of untrusted data (CWE-502), is when the application deserializes untrusted data without sufficiently verifying that the resulting data will be valid, letting the attacker to control the state or the flow of the execution.

Java deserialization issues have been known for years. However, interest in the issue intensified greatly in 2015, when classes that could be abused to achieve remote code execution were found in a popular library (Apache Commons Collection). These classes were used in zero-days affecting IBM WebSphere, Oracle WebLogic and many other products.

An attacker just needs to identify a piece of software that has both a vulnerable class on its path, and performs deserialization on untrusted data. Then all they need to do is send the payload into the deserializer, getting the command executed.

Developers put too much trust in Java Object Serialization. Some even de-serialize objects pre-authentication. When deserializing an Object in Java you typically cast it to an expected type, and therefore Java's strict type system will ensure you only get valid object trees. Unfortunately, by the time the type checking happens, platform code has already created and executed significant logic. So, before the final type is checked a lot of code is executed from the readObject() methods of various objects, all of which is out of the developer's control. By combining the readObject() methods of various classes which are available on the classpath of the vulnerable application, an attacker can execute functions (including calling Runtime.exec() to execute local OS commands).

Remediation

Upgrade com.google.code.gson:gson to version 2.8.9 or higher.

References

medium severity

Denial of Service (DoS)

  • Vulnerable module: com.squareup.okio:okio
  • Introduced through: org.aerogear:android-core@2.0.0, org.aerogear:android-auth@2.0.0 and others

Detailed paths

  • Introduced through: aerogear/android-showcase-template@aerogear/android-showcase-template#master/app org.aerogear:android-core@2.0.0 com.squareup.okhttp3:okhttp@3.9.1 com.squareup.okio:okio@1.13.0
  • Introduced through: aerogear/android-showcase-template@aerogear/android-showcase-template#master/app org.aerogear:android-auth@2.0.0 org.aerogear:android-core@2.0.0 com.squareup.okhttp3:okhttp@3.9.1 com.squareup.okio:okio@1.13.0
  • Introduced through: aerogear/android-showcase-template@aerogear/android-showcase-template#master/app org.aerogear:android-push@2.0.0 org.aerogear:android-core@2.0.0 com.squareup.okhttp3:okhttp@3.9.1 com.squareup.okio:okio@1.13.0
  • Introduced through: aerogear/android-showcase-template@aerogear/android-showcase-template#master/app org.aerogear:android-security@2.0.0 org.aerogear:android-core@2.0.0 com.squareup.okhttp3:okhttp@3.9.1 com.squareup.okio:okio@1.13.0

Overview

Affected versions of this package are vulnerable to Denial of Service (DoS) due to improper exception handling by the GzipSource class when parsing a malformed gzip buffer.

This vulnerability can be exploited on the Okio client when handling a crafted GZIP archive.

PoC

val gzBuf: Buffer = Buffer()
    try {
        val gzByteString: ByteString = ("1f8b41ff424242424343ffff").decodeHex()
        gzBuf.write(gzByteString)
        val gz: GzipSource = GzipSource(gzBuf)
        val sinkBuf: Buffer = Buffer()
        gz.read(sinkBuf, 5)
    }
    catch(e: IOException) {
        println("got error: " + e.toString())
    }

Details

Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its intended and legitimate users.

Unlike other vulnerabilities, DoS attacks usually do not aim at breaching security. Rather, they are focused on making websites and services unavailable to genuine users resulting in downtime.

One popular Denial of Service vulnerability is DDoS (a Distributed Denial of Service), an attack that attempts to clog network pipes to the system by generating a large volume of traffic from many machines.

When it comes to open source libraries, DoS vulnerabilities allow attackers to trigger such a crash or crippling of the service by using a flaw either in the application code or from the use of open source libraries.

Two common types of DoS vulnerabilities:

  • High CPU/Memory Consumption- An attacker sending crafted requests that could cause the system to take a disproportionate amount of time to process. For example, commons-fileupload:commons-fileupload.

  • Crash - An attacker sending crafted requests that could cause the system to crash. For Example, npm ws package

Remediation

Upgrade com.squareup.okio:okio to version 1.17.6, 3.4.0 or higher.

References

medium severity

Inadequate Encryption Strength

  • Vulnerable module: org.bitbucket.b_c:jose4j
  • Introduced through: org.aerogear:android-auth@2.0.0

Detailed paths

  • Introduced through: aerogear/android-showcase-template@aerogear/android-showcase-template#master/app org.aerogear:android-auth@2.0.0 org.bitbucket.b_c:jose4j@0.6.3

Overview

org.bitbucket.b_c:jose4j is a robust and easy to use open source implementation of JSON Web Token (JWT) and the JOSE specification suite (JWS, JWE, and JWK). It is written in Java and relies solely on the JCA APIs for cryptography. Please see https://bitbucket.org/b_c/jose4j/wiki/Home for more info, examples, etc...

Affected versions of this package are vulnerable to Inadequate Encryption Strength through the iteration count setting, which can reduce the computational effort required to crack the encryption if it is set to a low value.

Remediation

Upgrade org.bitbucket.b_c:jose4j to version 0.9.3 or higher.

References

medium severity

Information Exposure

  • Vulnerable module: com.squareup.okhttp3:okhttp
  • Introduced through: org.aerogear:android-core@2.0.0, org.aerogear:android-auth@2.0.0 and others

Detailed paths

  • Introduced through: aerogear/android-showcase-template@aerogear/android-showcase-template#master/app org.aerogear:android-core@2.0.0 com.squareup.okhttp3:okhttp@3.9.1
  • Introduced through: aerogear/android-showcase-template@aerogear/android-showcase-template#master/app org.aerogear:android-auth@2.0.0 org.aerogear:android-core@2.0.0 com.squareup.okhttp3:okhttp@3.9.1
  • Introduced through: aerogear/android-showcase-template@aerogear/android-showcase-template#master/app org.aerogear:android-push@2.0.0 org.aerogear:android-core@2.0.0 com.squareup.okhttp3:okhttp@3.9.1
  • Introduced through: aerogear/android-showcase-template@aerogear/android-showcase-template#master/app org.aerogear:android-security@2.0.0 org.aerogear:android-core@2.0.0 com.squareup.okhttp3:okhttp@3.9.1

Overview

com.squareup.okhttp3:okhttp is a HTTP & HTTP/2 client for Android and Java applications

Affected versions of this package are vulnerable to Information Exposure. When there's an illegal character in a header value, an IllegalArgumentException is thrown whose message includes the full header value.

PoC

package com.launchdarkly.eventsource;

import okhttp3.*;
import org.junit.Test;
import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;

public class OkhttpHeaderExceptionTest {
  @Test
  public void invalidHeaderValueIsCapturedInException() throws Exception {
    String password = "very-secret-password";
    String badValue = password + "\n";
    
    try {
      Request req = new Request.Builder().url("http://github.com/path/doesnt/matter")
          .header("Authorization", badValue)
          .build();
    } catch (IllegalArgumentException e) {
      assertThat(e.getMessage(), not(containsString(password)));
    }
  }
}

Remediation

Upgrade com.squareup.okhttp3:okhttp to version 4.9.2 or higher.

References