Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should (some) builtins become legal path expressions? #23

Closed
d-maurer opened this issue Jul 3, 2020 · 4 comments
Closed

Should (some) builtins become legal path expressions? #23

d-maurer opened this issue Jul 3, 2020 · 4 comments
Assignees

Comments

@d-maurer
Copy link
Contributor

d-maurer commented Jul 3, 2020

In "plone/Products.CMFPlone#3135 (comment)"
@vincentfretin asks whether tal:omit-tag="True" can again become legal.

With Zope, the default TALES expression type is path and according to the Zope Book any path expression starts with a "variable" defined as either a predefined variable (such as nothing, default, context, ...) or a variable defined by the template. According to this specification, True is not a valid path expression -- and is rejected.

The former chameleon.tales based TALES implementation was less strict: a path expression did not need to start with a variable, some builtins ( I do not yet know the precise set - but it included True and False) and internals (that included default) were allowed as well.
And what is allowed and fairly natural (like the tal:omit-tag=True) has a good chance to have been used somewhere. And those places break now with the stricter requirements on path expressions.

Should we relax the requirements on path expressions (and thus make expressions like the above legal)?

Should we support as leading element of a path expression beside a variable
only a small set of builtins (including True and False) or any legal builtin (i.e. any Python builtin for a trusted engine and any AccessControl.safe_builtins for a untrusted engine)?

@dataflake
Copy link
Member

If it's not too much work then anything that makes "pure" Chameleon and our version more similar is a win as long as security isn't affected negatively.

@dataflake dataflake transferred this issue from zopefoundation/Zope Jul 6, 2020
@dataflake dataflake changed the title Products.PageTemplates: should (some) builtins become legal path expressions? Should (some) builtins become legal path expressions? Jul 6, 2020
@dataflake
Copy link
Member

Fixed in 0e55a38 and just waiting for PyPI access to publish release 5.1

@dataflake
Copy link
Member

zope.tales 5.1 is now published and the version pins for Zope 4.x and master have been updated to use it.

@dataflake
Copy link
Member

The Zope bits are on 4.x (zopefoundation/Zope@400947d) and master (zopefoundation/Zope@2abe4eb) now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants