# GHSA-p5wf-cmr4-xrwr: Permissive Regular Expression in tacquito

> A permissive regex in tacquito allows unauthorized command execution on network devices by bypassing intended command authorization checks.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 18 Oct 2024
- **Also known as:** GO-2024-3207

## What is GHSA-p5wf-cmr4-xrwr?

GHSA-p5wf-cmr4-xrwr is a vulnerability in github.com/facebookincubator/tacquito, published on 18 Oct 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

### Impact
The CVE is for a software vulnerability. Network admins who have deployed tacquito (or versions of tacquito) in their production environments and use tacquito to perform command authorization for network devices should be impacted.

Tacquito code prior to commit 07b49d1358e6ec0b5aa482fcd284f509191119e2 was performing regex matches on authorized commands and arguments in a more permissive than intended manner. Configured allowed commands/arguments were intended to require a match on the entire string, but instead only enforced a match on a sub-string. This behaviour could potentially allowed unauthorized commands to be executed.

### Patches
The problem has been patched, and users should update to the latest github repo commit to get the patch. 

### Workarounds
Users should be able to add boundary conditions anchors '^' and '$' to their command configs to remediate the vulnerability without the upgrade

## Which versions are affected by GHSA-p5wf-cmr4-xrwr?

3 open source packages ship an affected version, including github.com/facebookincubator/tacquito.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/facebookincubator/tacquito` | Go | All versions | 0.0.0-20241011192817-07b49d1358e6 |
| `github.com/facebookincubator/tacquito` | Go | All versions | 0.0.0-20241011192817-07b49d1358e6 |
| `github.com/facebookincubator/tacquito` | Go | All versions | 0.0.0-20241011192817-07b49d1358e6 |

## How do I fix GHSA-p5wf-cmr4-xrwr?

Upgrade github.com/facebookincubator/tacquito to 0.0.0-20241011192817-07b49d1358e6 or later.

## Is GHSA-p5wf-cmr4-xrwr being exploited?

There is no known exploitation of GHSA-p5wf-cmr4-xrwr in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-p5wf-cmr4-xrwr and fix it if it is affected.

What it is: GHSA-p5wf-cmr4-xrwr is a vulnerability in github.com/facebookincubator/tacquito, published on 18 Oct 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-p5wf-cmr4-xrwr in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/facebookincubator/tacquito (Go): affected all versions; fixed in 0.0.0-20241011192817-07b49d1358e6
- github.com/facebookincubator/tacquito (Go): affected all versions; fixed in 0.0.0-20241011192817-07b49d1358e6
- github.com/facebookincubator/tacquito (Go): affected all versions; fixed in 0.0.0-20241011192817-07b49d1358e6

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-p5wf-cmr4-xrwr/ (Markdown: https://insights.sbomify.com/GHSA-p5wf-cmr4-xrwr/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-p5wf-cmr4-xrwr

---
From sbomify Insights: https://insights.sbomify.com/GHSA-p5wf-cmr4-xrwr/
Summaries are generated and may contain mistakes; the official description above is the record.
