CVE-2020-5222: Opencast kernel Hard-Coded Key Used For Remember-me Vulnerability

MODERATE
Advisory Identifier: GHSA-mh8g-hprg-8363
CVSS 6.8
CWE-798
Published
Advisory Summary

CVE-2020-5222 is a MODERATE (CVSS 6.8) hard-coded key used for remember-me vulnerability (CWE-798: Use of Hard-coded Credentials) affecting Opencast kernel libraries in the Maven ecosystem. The issue involves hard-coded key used for remember-me token in opencast. Remediation is available by upgrading affected packages to version 7.6, 8.1.

CVE-2020-5222 at a Glance

CVE Identifier CVE-2020-5222
GHSA Identifier GHSA-mh8g-hprg-8363
Severity MODERATE
CVSS v3.1 Base Score 6.8
CWE Classification CWE-798: Use of Hard-coded Credentials
Affected Product Opencast kernel
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 6.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2020-5222

To remediate this vulnerability, upgrade all affected Opencast kernel dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.opencastproject:opencast-kernel fixed: 7.6
<dependency>
    <groupId>org.opencastproject</groupId>
    <artifactId>opencast-kernel</artifactId>
    <version>7.6</version>
</dependency>
org.opencastproject:opencast-kernel fixed: 8.1
<dependency>
    <groupId>org.opencastproject</groupId>
    <artifactId>opencast-kernel</artifactId>
    <version>8.1</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.opencastproject

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2020-5222, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.opencastproject

Analyze the terminal output to locate any version of Opencast kernel in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.6), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.opencastproject command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-798: Use of Hard-coded Credentials, where the product contains hard-coded credentials, such as a password or cryptographic key. In Opencast kernel, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact The security configuration in `etc/security/mh_default_org.xml` enables a remember-me cookie based on a hash created from the [username, password, and an additional system key](https://docs.spring.io/spring-security/site/docs/3.0.x/reference/remember-me.html). Opencast has hard-coded this system key in the large XML file and never mentions to change this, basically ensuring that all systems use the same key: ```xml <sec:remember-me key="opencast" user-service-ref="userDetailsService" /> ``` This means that an attacker getting access to a remember-me token for one server can get access to all servers which allow log-in using the same credentials without ever needing the credentials. For example, a remember-me token obtained from develop.opencast.org can be used on stable.opencast.org without actually knowing the log-in credentials. Such an attack will usually not work on different installations – assuming that safe, unique passwords are used – but it is basically guaranteed to work to get access to all machines of one cluster if a token from one machine is compromised. ### Patches This problem is fixed in Opencast 7.6 and Opencast 8.1 ### Workarounds We strongly recommend updating to the patched version. Still, as a workaround for older versions, in `etc/security/mh_default_org.xml`, set a custom key for each server: ```xml <sec:remember-me key="CUSTOM_RANDOM_KEY" user-service-ref="userDetailsService" /> ``` ### References - [Relevant lines in the security configuration](https://github.com/opencast/opencast/blob/161ee619382f144dc35eea211fc6b556025b98e1/etc/security/mh_default_org.xml#L335-L336) - [Spring Security Remember-Me Authentication Documentation](https://docs.spring.io/spring-security/site/docs/3.0.x/reference/remember-me.html#remember-me-hash-token) ### For more information If you have any questions or comments about this advisory: - Open an issue in [opencast/opencast](https://github.com/opencast/opencast/issues) - For security-relevant information, email us at [security@opencast.org](mailto:security@opencast.org) ### Thanks Thanks to @LukasKalbertodt for reporting the issue.

CVE-2020-5222 Affected Opencast kernel Versions

2 component(s)
Fixed Versions:
7.68.1
Product / Package Ecosystem Affected Versions Fixed Version
org.opencastproject:opencast-kernel
Maven
< 7.6
7.6
org.opencastproject:opencast-kernel
Maven
≥ 8.0
< 8.1
8.1

References

Frequently Asked Questions

What is CVE-2020-5222?
CVE-2020-5222 is a security vulnerability in Opencast kernel involving Hard-Coded Key Used For Remember-me Token in Opencast under CWE-798: Use of Hard-coded Credentials.
Which Opencast kernel versions are affected?
Affected versions include releases prior to 7.6, 8.1 across affected packages: org.opencastproject:opencast-kernel.
What version fixes CVE-2020-5222?
Upgrading to 7.6, 8.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is opencast-kernel affected?
Yes, org.opencastproject:opencast-kernel is affected in releases prior to 7.6, 8.1. Upgrade your dependency to 7.6, 8.1 or later.
What is the CVSS score of CVE-2020-5222?
CVE-2020-5222 has a CVSS v3.1 base score of 6.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2020-5222?
CVE-2020-5222 is classified under CWE-798: Use of Hard-coded Credentials (The product contains hard-coded credentials, such as a password or cryptographic key.).
How can I check Maven dependencies for CVE-2020-5222?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.opencastproject'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mh8g-hprg-8363",
  "modified" : "2021-10-20T18:03:56Z",
  "published" : "2020-01-30T21:21:44Z",
  "aliases" : [ "CVE-2020-5222" ],
  "summary" : "Hard-Coded Key Used For Remember-me Token in Opencast",
  "details" : "### Impact\n\nThe security configuration in `etc/security/mh_default_org.xml` enables a remember-me cookie based on a hash created from the [username, password, and an additional system key](https://docs.spring.io/spring-security/site/docs/3.0.x/reference/remember-me.html). Opencast has hard-coded this system key in the large XML file and never mentions to change this, basically ensuring that all systems use the same key:\n\n```xml\n<sec:remember-me key=\"opencast\" user-service-ref=\"userDetailsService\" />\n```\n\nThis means that an attacker getting access to a remember-me token for one server can get access to all servers which allow log-in using the same credentials without ever needing the credentials. For example, a remember-me token obtained from develop.opencast.org can be used on stable.opencast.org without actually knowing the log-in credentials.\n\nSuch an attack will usually not work on different installations – assuming that safe, unique passwords are used – but it is basically guaranteed to work to get access to all machines of one cluster if a token from one machine is compromised.\n\n### Patches\n\nThis problem is fixed in Opencast 7.6 and Opencast 8.1\n\n### Workarounds\n\nWe strongly recommend updating to the patched version. Still, as a workaround for older versions, in `etc/security/mh_default_org.xml`, set a custom key for each server:\n\n```xml\n<sec:remember-me key=\"CUSTOM_RANDOM_KEY\" user-service-ref=\"userDetailsService\" />\n```\n\n### References\n\n- [Relevant lines in the security configuration](https://github.com/opencast/opencast/blob/161ee619382f144dc35eea211fc6b556025b98e1/etc/security/mh_default_org.xml#L335-L336)\n- [Spring Security Remember-Me Authentication Documentation](https://docs.spring.io/spring-security/site/docs/3.0.x/reference/remember-me.html#remember-me-hash-token)\n\n### For more information\nIf you have any questions or comments about this advisory:\n- Open an issue in [opencast/opencast](https://github.com/opencast/opencast/issues)\n- For security-relevant information, email us at [security@opencast.org](mailto:security@opencast.org)\n\n### Thanks\nThanks to @LukasKalbertodt for reporting the issue.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.opencastproject:opencast-kernel"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.opencastproject:opencast-kernel"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0"
      }, {
        "fixed" : "8.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/opencast/opencast/security/advisories/GHSA-mh8g-hprg-8363"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-5222"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/opencast/opencast/commit/1a7172c95af8d542a77ae5b153e4c834dd4788a6"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-798" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-01-30T20:48:17Z",
    "nvd_published_at" : null
  }
}