Problem/Motivation

Recipes can refer to other recipes three ways:

None of these should ever accept a period anywhere in the include name. Since they all ultimately map to filesystem paths, periods could potentially lead to path traversal bugs. I'm not aware of any such problems in the wild, but let's close that loophole anyway.

Proposed resolution

When a recipe is parsed and validated, the presence of a period anywhere in the included recipe list should throw an exception. For good measure, RecipeConfigurator should also throw an exception if getIncludedRecipe() is given a $name with a period in it.

Remaining tasks

Implement with tests.

User interface changes

None.

Introduced terminology

None.

API changes

None.

Data model changes

None.

Release notes snippet

None needed.

Issue fork drupal-3639511

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

phenaproxima created an issue. See original summary.

phenaproxima’s picture

Issue summary: View changes

phenaproxima’s picture

Status: Active » Needs review

It turns out we don't need to change anything in \Drupal\Core\Recipe\Recipe::parse(), because putting the exception in RecipeConfigurator means the validation never even finishes before the exception is thrown. So the API-level guard, to use a ClaudeWord, is good enough to cover all bases.

nicxvan’s picture

Status: Needs review » Needs work