GHSA-7852-w36x-6mf6: Laravel/framework Laravel Encrypter Component Potential Decryption Vulnerability

MODERATE
CWE-1240
Published
Advisory Summary

GHSA-7852-w36x-6mf6 is a MODERATE laravel encrypter component potential decryption vulnerability (CWE-1240: Use of a Cryptographic Primitive with a Risky Implementation) affecting Laravel/framework libraries in the Packagist ecosystem. The issue involves laravel encrypter component potential decryption failure leading to unintended behavior. Remediation is available by upgrading affected packages to version 5.5.40, 5.6.15.

GHSA-7852-w36x-6mf6 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-7852-w36x-6mf6
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-1240: Use of a Cryptographic Primitive with a Risky Implementation
Affected Product Laravel/framework
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix GHSA-7852-w36x-6mf6

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

laravel/framework fixed: 5.5.40
Upgrade laravel/framework to 5.5.40
laravel/framework fixed: 5.6.15
Upgrade laravel/framework to 5.6.15
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 laravel/framework

How to Check if You Are Affected

To determine whether your application is affected by GHSA-7852-w36x-6mf6, inspect your project dependencies for Laravel/framework:

inspect dependencies for laravel/framework

Analyze the terminal output to locate any version of Laravel/framework in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.5.40), 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-1240: Use of a Cryptographic Primitive with a Risky Implementation, where to fulfill the need for a cryptographic primitive, the product implements a cryptographic algorithm using a non-standard, unproven, or disallowed/non-compliant cryptographic implementation. In Laravel/framework, 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

The Laravel Encrypter component is susceptible to a vulnerability that may result in decryption failure, leading to an unexpected return of `false`. Exploiting this issue requires the attacker to manipulate the encrypted payload before decryption. When combined with weak type comparisons in the application's code, such as the example below: ``` <?php $decyptedValue = decrypt($secret); if ($decryptedValue == '') { // Code is run even though decrypted value is false... } ```

GHSA-7852-w36x-6mf6 Affected Laravel/framework Versions

2 component(s)
Fixed Versions:
5.5.405.6.15
Product / Package Ecosystem Affected Versions Fixed Version
laravel/framework
Packagist
< 5.5.40
5.5.40
laravel/framework
Packagist
≥ 5.6.0
< 5.6.15
5.6.15

References

Frequently Asked Questions

What is GHSA-7852-w36x-6mf6?
GHSA-7852-w36x-6mf6 is a security vulnerability in Laravel/framework involving Laravel Encrypter Component Potential Decryption Failure Leading to Unintended Behavior under CWE-1240: Use of a Cryptographic Primitive with a Risky Implementation.
Which Laravel/framework versions are affected?
Affected versions include releases prior to 5.5.40, 5.6.15 across affected packages: laravel/framework.
What version fixes GHSA-7852-w36x-6mf6?
Upgrading to 5.5.40, 5.6.15 (or the latest patched release for your respective branch) resolves the vulnerability.
Is laravel/framework affected?
Yes, laravel/framework is affected in releases prior to 5.5.40, 5.6.15. Upgrade your dependency to 5.5.40, 5.6.15 or later.
What CWE is associated with GHSA-7852-w36x-6mf6?
GHSA-7852-w36x-6mf6 is classified under CWE-1240: Use of a Cryptographic Primitive with a Risky Implementation (To fulfill the need for a cryptographic primitive, the product implements a cryptographic algorithm using a non-standard, unproven, or disallowed/non-compliant cryptographic implementation.).
How can I check Packagist dependencies for GHSA-7852-w36x-6mf6?
Run the dependency tree command: 'inspect dependencies for laravel/framework'. 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-7852-w36x-6mf6",
  "modified" : "2024-05-15T22:08:06Z",
  "published" : "2024-05-15T22:08:06Z",
  "aliases" : [ ],
  "summary" : "Laravel Encrypter Component Potential Decryption Failure Leading to Unintended Behavior",
  "details" : "The Laravel Encrypter component is susceptible to a vulnerability that may result in decryption failure, leading to an unexpected return of `false`. Exploiting this issue requires the attacker to manipulate the encrypted payload before decryption. When combined with weak type comparisons in the application's code, such as the example below:\n\n```\n<?php\n\n$decyptedValue = decrypt($secret);\n\nif ($decryptedValue == '') {\n    // Code is run even though decrypted value is false...\n}\n```",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "laravel/framework"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.5.40"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "laravel/framework"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.6.0"
      }, {
        "fixed" : "5.6.15"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/laravel/framework/commit/28e53f23a76206fb130e9a54eb95aa3f010e79c9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/laravel/framework/commit/886d261df0854426b4662b7ed5db6a1c575a4279"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/laravel/framework/2018-03-30-1.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/laravel/framework"
  }, {
    "type" : "WEB",
    "url" : "https://medium.com/@taylorotwell/laravel-security-release-5-6-15-and-5-5-40-56f1257933a0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1240" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-15T22:08:06Z",
    "nvd_published_at" : null
  }
}