CVE-2021-41170: Neoan3 apps/template Insecure Inherited Permissions Vulnerability
HIGHCVE-2021-41170 is a HIGH (CVSS 7.5) insecure inherited permissions vulnerability (CWE-732: Incorrect Permission Assignment for Critical Resource) affecting Neoan3 apps/template libraries in the Packagist ecosystem. The issue involves insecure inherited permissions in neoan3-apps/template. Remediation is available by upgrading affected packages to version 1.1.1.
CVE-2021-41170 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).
How to Fix CVE-2021-41170
To remediate this vulnerability, upgrade all affected Neoan3 apps/template dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade neoan3-apps/template to 1.1.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for neoan3-apps/template
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-41170, inspect your project dependencies for Neoan3 apps/template:
inspect dependencies for neoan3-apps/template
Analyze the terminal output to locate any version of Neoan3 apps/template in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.1), 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-732: Incorrect Permission Assignment for Critical Resource, where the product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors. In Neoan3 apps/template, 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
CVE-2021-41170 Affected Neoan3 apps/template Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
neoan3-apps/template
|
Packagist |
< 1.1.1
|
1.1.1
|
References
Frequently Asked Questions
What is CVE-2021-41170?
Which Neoan3 apps/template versions are affected?
What version fixes CVE-2021-41170?
Is neoan3-apps/template affected?
What is the CVSS score of CVE-2021-41170?
What CWE is associated with CVE-2021-41170?
How can I check Packagist dependencies for CVE-2021-41170?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-3v56-q6r6-4gcw",
"modified" : "2021-11-08T21:04:44Z",
"published" : "2021-11-10T16:41:08Z",
"aliases" : [ "CVE-2021-41170" ],
"summary" : "Insecure Inherited Permissions in neoan3-apps/template",
"details" : "### Impact\nVersions prior 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. \n\nIn 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. \n\n\n### Patches\nVersion 1.1.1 has addressed this vulnerability. \n```php\n$params = [\n 'reverse' => fn($input) => strrev($input), // <-- no longer possible with version ~1.1.1\n 'value' => 'My website' \n]\nTemplateFunctions::registerClosure('reverse', fn($input) => strrev($input)); // <-- still possible (and nicely isolated)\nTemplate::embrace('<h1>{{reverse(value)}}</h1>', $params);\n```\n\n### Workarounds\nUnfortunately only working with hardcoded values is safe in prior versions. As this likely defeats the purpose of a template engine, please upgrade.\n\n### References\nAs a possible exploit is relatively easy to achieve, I will not share steps to reproduce the issue for now.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [our repo](https://github.com/sroehrl/neoan3-template)\n\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "neoan3-apps/template"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.1.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/sroehrl/neoan3-template/security/advisories/GHSA-3v56-q6r6-4gcw"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-41170"
}, {
"type" : "WEB",
"url" : "https://github.com/sroehrl/neoan3-template/issues/8"
}, {
"type" : "WEB",
"url" : "https://github.com/sroehrl/neoan3-template/commit/4a2c9570f071d3c8f4ac790007599cba20e16934"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/sroehrl/neoan3-template"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-277", "CWE-732", "CWE-74" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-11-08T21:04:44Z",
"nvd_published_at" : "2021-11-08T19:15:00Z"
}
}