Vulnerabilities in pkg:golang/github.com/edgexfoundry/app-functions-sdk-go

PACKAGE
Advisory Identifier: GHSA-6c7m-qwxj-mvhp
Advisory Summary

CVE-2021-41278 is a MODERATE (CVSS 5.4) broken encryption vulnerability (CWE-327: Use of a Broken or Risky Cryptographic Algorithm) affecting Github.com/edgexfoundry/app functions sdk go/v2 libraries in the Go ecosystem. The issue involves broken encryption in edgex foundry. Remediation is available by upgrading affected packages to version 2.1.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/edgexfoundry/app-functions-sdk-go

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/edgexfoundry/app-functions-sdk-go. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-6c7m-qwxj-mvhp CVE-2021-41278 MODERATE Broken encryption in EdgeX Foundry

CVE-2021-41278 at a Glance

CVE Identifier CVE-2021-41278
GHSA Identifier GHSA-6c7m-qwxj-mvhp
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-327: Use of a Broken or Risky Cryptographic Algorithm
Affected Product Github.com/edgexfoundry/app functions sdk go/v2
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.4

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

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

How to Fix CVE-2021-41278

To remediate this vulnerability, upgrade all affected Github.com/edgexfoundry/app functions sdk go/v2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/edgexfoundry/app-functions-sdk-go/v2 fixed: 2.1.0
Upgrade github.com/edgexfoundry/app-functions-sdk-go/v2 to 2.1.0
github.com/edgexfoundry/app-functions-sdk-go fixed: Latest secure release
Upgrade github.com/edgexfoundry/app-functions-sdk-go to Latest secure release
github.com/edgexfoundry/app-service-configurable fixed: 2.1.0
Upgrade github.com/edgexfoundry/app-service-configurable to 2.1.0
Verify Direct and Transitive Dependencies

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

inspect dependencies for github.com/edgexfoundry/app-functions-sdk-go/v2

How to Check if You Are Affected

To determine whether your application is affected by CVE-2021-41278, inspect your project dependencies for Github.com/edgexfoundry/app functions sdk go/v2:

inspect dependencies for github.com/edgexfoundry/app-functions-sdk-go/v2

Analyze the terminal output to locate any version of Github.com/edgexfoundry/app functions sdk go/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-327: Use of a Broken or Risky Cryptographic Algorithm, where the product uses a broken or risky cryptographic algorithm or protocol. In Github.com/edgexfoundry/app functions sdk go/v2, 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

### Summary Broken encryption in app-functions-sdk “AES” transform in EdgeX Foundry releases prior to Jakarta allows attackers to decrypt messages via unspecified vectors. ### Detailed Description The app-functions-sdk exports an “aes” transform that user scripts can optionally call to encrypt data in the processing pipeline. No decrypt function is provided. Encryption is not enabled by default, but if used, the level of protection may be less than the user may expects due to a broken implementation in https://github.com/edgexfoundry/app-functions-sdk-go/blob/v1.0.0/pkg/transforms/encryption.go Version v2.1.0 (EdgeX Foundry Jakarta release and later) of app-functions-sdk-go/v2 deprecates the “aes” transform and provides an improved “aes256” transform in its place. The broken implementation will remain in a deprecated state until it is removed in the next EdgeX major release to avoid breakage of existing software that depends on the broken implementation. ### Impact As the broken transform is a library function that is not invoked by default, users who do not use the AES transform in their processing pipelines are unaffected. Those that are affected are urged to upgrade to the Jakarta EdgeX release and modify processing pipelines to use the new "aes256" transform. #### Vulnerable go modules - github.com/edgexfoundry/app-functions-sdk-go < v2.1.0 - github.com/edgexfoundry/app-functions-sdk-go/v2 < v2.1.0 - github.com/edgexfoundry/app-service-configurable < v2.1.0 #### Vulnerable containers - https://hub.docker.com/r/edgexfoundry/app-service-configurable >= 2.0.0 < v2.1.0 - https://hub.docker.com/r/edgexfoundry/app-service-configurable-arm64 >= 2.0.0 < 2.1.0 - https://hub.docker.com/r/edgexfoundry/docker-app-service-configurable < 2.0.0 - https://hub.docker.com/r/edgexfoundry/docker-app-service-configurable-arm64 < 2.0.0 #### Vulnerable Snaps - https://snapcraft.io/edgex-app-service-configurable >= 2.0.0 < 2.1.0 ### Patches Upgrade to 2.1.0 version of app-functions-sdk-go/v2, app-service-configurable, and related docker containers shown below and modify user scripts to use the new "aes256" transform in place of the existing "aes" transform. #### Patched go modules - github.com/edgexfoundry/app-functions-sdk-go/v2 v2.1.0 - github.com/edgexfoundry/app-service-configurable v2.1.0 Modification of user scripts is necessary for full remediation. #### Patched containers - https://hub.docker.com/r/edgexfoundry/app-service-configurable:>=2.1.0 - https://hub.docker.com/r/edgexfoundry/app-service-configurable-arm64:>=2.1.0 Modification of user scripts is necessary for full remediation. #### Patched Snaps - https://snapcraft.io/edgex-app-service-configurable >= 2.1.0 Modification of user scripts is necessary for full remediation. ### Workarounds If unable to upgrade, change the processing pipeline to use an HTTPS (TLS 1.3) endpoint to export and skip encryption. ### References * [2.0 documentation](https://docs.edgexfoundry.org/2.0/microservices/application/BuiltIn/#aes) * [2.1 documentation](https://docs.edgexfoundry.org/2.1/microservices/application/BuiltIn/#encryption-deprecated) * [GitHub issue](https://github.com/edgexfoundry/app-functions-sdk-go/issues/968) ### For more information If you have any questions or comments about this advisory: * Contact us in the [Slack #security channel](https://slack.edgexfoundry.org/) * Open an issue in [edgex-go](https://github.com/edgexfoundry/edgex-go) * Email us at [EdgeX-TSC-Security@lists.edgexfoundry.org](mailto:EdgeX-TSC-Security@lists.edgexfoundry.org)

CVE-2021-41278 Affected Github.com/edgexfoundry/app functions sdk go/v2 Versions

3 component(s)
Fixed Versions:
2.1.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/edgexfoundry/app-functions-sdk-go/v2
Go
< 2.1.0
2.1.0
github.com/edgexfoundry/app-functions-sdk-go
Go
github.com/edgexfoundry/app-service-configurable
Go
< 2.1.0
2.1.0

References

Frequently Asked Questions

What is CVE-2021-41278?
CVE-2021-41278 is a security vulnerability in Github.com/edgexfoundry/app functions sdk go/v2 involving Broken encryption in EdgeX Foundry under CWE-327: Use of a Broken or Risky Cryptographic Algorithm.
Which Github.com/edgexfoundry/app functions sdk go/v2 versions are affected?
Affected versions include releases prior to 2.1.0 across affected packages: github.com/edgexfoundry/app-functions-sdk-go/v2, github.com/edgexfoundry/app-functions-sdk-go, github.com/edgexfoundry/app-service-configurable.
What version fixes CVE-2021-41278?
Upgrading to 2.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/edgexfoundry/app-functions-sdk-go/v2 affected?
Yes, github.com/edgexfoundry/app-functions-sdk-go/v2 is affected in releases prior to 2.1.0. Upgrade your dependency to 2.1.0 or later.
Is github.com/edgexfoundry/app-functions-sdk-go affected?
Yes, github.com/edgexfoundry/app-functions-sdk-go is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2021-41278?
CVE-2021-41278 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.0/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:L/A:N.
What CWE is associated with CVE-2021-41278?
CVE-2021-41278 is classified under CWE-327: Use of a Broken or Risky Cryptographic Algorithm (The product uses a broken or risky cryptographic algorithm or protocol.).
How can I check Go dependencies for CVE-2021-41278?
Run the dependency tree command: 'inspect dependencies for github.com/edgexfoundry/app-functions-sdk-go/v2'. 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-6c7m-qwxj-mvhp",
  "modified" : "2021-11-24T19:01:48Z",
  "published" : "2021-11-19T20:55:16Z",
  "aliases" : [ "CVE-2021-41278" ],
  "summary" : "Broken encryption in EdgeX Foundry",
  "details" : "### Summary\nBroken encryption in app-functions-sdk “AES” transform in EdgeX Foundry releases prior to Jakarta allows attackers to decrypt messages via unspecified vectors.\n\n### Detailed Description\nThe app-functions-sdk exports an “aes” transform that user scripts can optionally call to encrypt data in the processing pipeline.  No decrypt function is provided.  Encryption is not enabled by default, but if used, the level of protection may be less than the user may expects due to a broken implementation in https://github.com/edgexfoundry/app-functions-sdk-go/blob/v1.0.0/pkg/transforms/encryption.go \n\nVersion v2.1.0 (EdgeX Foundry Jakarta release and later) of app-functions-sdk-go/v2 deprecates the “aes” transform and provides an improved “aes256” transform in its place.  The broken implementation will remain in a deprecated state until it is removed in the next EdgeX major release to avoid breakage of existing software that depends on the broken implementation.\n\n### Impact\nAs the broken transform is a library function that is not invoked by default, users who do not use the AES transform in their processing pipelines are unaffected.  Those that are affected are urged to upgrade to the Jakarta EdgeX release and modify processing pipelines to use the new \"aes256\" transform.\n\n#### Vulnerable go modules\n- github.com/edgexfoundry/app-functions-sdk-go  < v2.1.0\n- github.com/edgexfoundry/app-functions-sdk-go/v2  < v2.1.0\n- github.com/edgexfoundry/app-service-configurable < v2.1.0\n\n#### Vulnerable containers\n- https://hub.docker.com/r/edgexfoundry/app-service-configurable >= 2.0.0 < v2.1.0\n- https://hub.docker.com/r/edgexfoundry/app-service-configurable-arm64  >= 2.0.0 < 2.1.0\n- https://hub.docker.com/r/edgexfoundry/docker-app-service-configurable  < 2.0.0\n- https://hub.docker.com/r/edgexfoundry/docker-app-service-configurable-arm64 < 2.0.0 \n\n#### Vulnerable Snaps\n- https://snapcraft.io/edgex-app-service-configurable >= 2.0.0 < 2.1.0\n\n### Patches\nUpgrade to 2.1.0 version of app-functions-sdk-go/v2, app-service-configurable, and related docker containers shown below and modify user scripts to use the new \"aes256\" transform in place of the existing \"aes\" transform.\n\n#### Patched go modules\n- github.com/edgexfoundry/app-functions-sdk-go/v2 v2.1.0\n- github.com/edgexfoundry/app-service-configurable v2.1.0\n\nModification of user scripts is necessary for full remediation.\n\n#### Patched containers\n- https://hub.docker.com/r/edgexfoundry/app-service-configurable:>=2.1.0\n- https://hub.docker.com/r/edgexfoundry/app-service-configurable-arm64:>=2.1.0\n\nModification of user scripts is necessary for full remediation.\n\n#### Patched Snaps\n- https://snapcraft.io/edgex-app-service-configurable >= 2.1.0\n\nModification of user scripts is necessary for full remediation.\n\n### Workarounds\nIf unable to upgrade, change the processing pipeline to use an HTTPS (TLS 1.3) endpoint to export and skip encryption.\n\n### References\n* [2.0 documentation](https://docs.edgexfoundry.org/2.0/microservices/application/BuiltIn/#aes)\n* [2.1 documentation](https://docs.edgexfoundry.org/2.1/microservices/application/BuiltIn/#encryption-deprecated)\n* [GitHub issue](https://github.com/edgexfoundry/app-functions-sdk-go/issues/968)\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Contact us in the [Slack #security channel](https://slack.edgexfoundry.org/)\n* Open an issue in [edgex-go](https://github.com/edgexfoundry/edgex-go)\n* Email us at [EdgeX-TSC-Security@lists.edgexfoundry.org](mailto:EdgeX-TSC-Security@lists.edgexfoundry.org)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/edgexfoundry/app-functions-sdk-go/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.1.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/edgexfoundry/app-functions-sdk-go"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "< 2.1.0"
    }
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/edgexfoundry/app-service-configurable"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.1.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/edgexfoundry/app-functions-sdk-go/security/advisories/GHSA-6c7m-qwxj-mvhp"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-41278"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/edgexfoundry/app-functions-sdk-go/commit/8fa13c6388ce76a6b878b54490eac61aa7d81165"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/edgexfoundry/app-functions-sdk-go"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-327" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-11-18T23:05:06Z",
    "nvd_published_at" : "2021-11-19T00:15:00Z"
  }
}