Laravel's Laravel Valet command flaw enables local root privilege escalation

Note: This data is for reference and cybersecurity research purposes only.CyStack advises users not to use this information for unlawful purposes.

What is CVE-2021-47756?

CVE-2021-47756 is a vulnerability classified as Incorrect Permission Assignment for Critical Resource, affecting Laravel Valet (affected versions: 1.1.4 to 2.0.3). This vulnerability is rated High, with a CVSS score of 8.4. Public exploit code or evidence is available for this vulnerability, but that does not confirm exploitation in the wild.

Overview

Original source data

Laravel Valet versions 1.1.4 to 2.0.3 contain a local privilege escalation vulnerability that allows users to modify the valet command with root privileges. Attackers can edit the symlinked valet command to execute arbitrary code with root permissions without additional authentication.

Affected products and scope

  • Laravel Valet on macOS: versions 1.1.4 to 2.0.3 are identified as affected.
  • The public exploit entry states that the issue was reintroduced in version 2.0.7 through the trust command. The available evidence does not define the full affected range after that reintroduction.
  • Laravel documentation describes Valet as a macOS development environment commonly installed with Homebrew and Composer. The available evidence does not confirm impact on other platforms.
  • The supplied record does not identify an exact fixed release.

Technical details

On macOS, the installed valet command is a symbolic link from /usr/local/bin/valet to a Composer-managed file within the user's control. Valet's installation or trust flow can create a sudoers rule allowing /usr/local/bin/valet * to run as root without another password prompt. This is an incorrect permission assignment for a critical resource: a local user can modify the command target that a privileged rule later executes. At a high level, exploitation requires local access, write access to that target, and a system where the Valet sudoers rule is present and usable. The modified command then runs in a root context, enabling arbitrary code execution with host-level confidentiality, integrity, and availability consequences. The public material does not establish whether every installation has the same sudoers state, so exposure should be verified on each host.

Exploitability

  • The vulnerability is described as locally reachable on macOS, not as a remotely reachable network attack.
  • The attacker must have a local account and be able to write to the target of the valet symbolic link. The CNA description states that no additional authentication is required once this write condition exists.
  • The supplied scoring data is inconsistent about whether initial privileges are required. Operationally, defenders should assume that local account access and write access to the target are necessary prerequisites.
  • A public proof of concept is available in Exploit Database. The PoC checks the product version and write access before acting, but it should not be copied or run on production systems.
  • The reviewed sources document a public exploit but do not name a campaign, victim, or specific real-world exploitation activity.

Technical impact

The flaw can turn a local user's write access to the Valet command into arbitrary code execution as root on the same host. Technical consequences may include reading, modifying, or deleting local files, changing processes and services, installing persistence, or disrupting the development environment. The described scope is local to the host and does not show that the flaw by itself provides network access or movement to other systems. The available evidence does not confirm a specific data-theft, lateral-movement, or breach scenario.

Business impact

  • If exploited on a development machine, the attacker could gain root control and alter source code, configuration, development tools, or local services.
  • Root access could permit reading or modifying data and credentials stored on the host, installing persistence, or disrupting the development environment. These are possible consequences of root access, not a reported breach scenario.
  • Shared workstations, systems with multiple local accounts, and hosts handling source code or deployment secrets should receive priority review.
  • The reviewed sources do not identify a victim, data breach, or specific campaign.

Remediation

  1. Use a Laravel-confirmed fixed release when one is identified. The supplied record and reviewed advisory do not provide an exact fixed version, so do not infer that every release after 2.0.3 is safe.
  2. Until the fix is confirmed, review and remove or restrict the sudoers rule that permits /usr/local/bin/valet * to run without a password, where operationally appropriate. Do not restore this privilege before validating the actual version and configuration.
  3. Ensure that the symbolic link and Composer-managed Valet command cannot be modified by unprivileged local users. If ownership, permissions, or file contents are unexpected, isolate the host and reinstall Valet from a trusted source.
  4. Review systems that have used the trust command, because the public exploit states that the issue was reintroduced through that command in 2.0.7. Do not treat 2.0.7 as a fixed release based on the available evidence.
  5. If unauthorized modification or unexpected root execution of Valet is found, handle the host as a local integrity incident, preserve evidence, and rotate potentially exposed credentials after containment.

Detection

  1. Inventory macOS systems with Laravel Valet installed through Composer and record the installed version for comparison with the affected branches.
  2. Locate the command with which valet, then inspect whether /usr/local/bin/valet is a symbolic link to a user-owned file in a Composer directory.
  3. Check ownership and write permissions on the link target. An unprivileged user should not be able to modify a command that can be run as root.
  4. Review files under /etc/sudoers.d/ and the applicable sudoers configuration for the VALET alias, the /usr/local/bin/valet * rule, and the NOPASSWD option.
  5. Compare the Valet command contents with a trusted installation and review audit or shell logs for root executions of valet and unexpected changes to the target file. This is precautionary monitoring, not a confirmed indicator of compromise.
  6. Do not treat the absence of suspicious log entries as proof of safety. Combine version, symbolic-link, write-permission, and sudoers checks.
Sources (25)
Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.