? Success

User tests: Successful: Unsuccessful:

avatar piotr-cz
piotr-cz
7 Jan 2014

Issue tracker item 33089

At this moment when using a form field description

<fieldset description="COM_EXAMPLE_DESC" />

with language string

COM_EXAMPLE_DESC="This is <strong>important!</strong>"

The translation is being escaped in views:

echo '<p class="tip">' . $this->escape(JText::_($fieldSet->description)) . '</p>';

preventing use HTML tags in the description:
This is <strong>important!</strong>
and not
This is important!

However this is not a case for

So I think HTML escaping should be removed for fieldset descriptions.
This allows to be more descriptive, add hyperlinks, images, etc.

avatar piotr-cz piotr-cz - open - 7 Jan 2014
avatar betweenbrain
betweenbrain - comment - 7 Jan 2014

Nice! Is there a tracker item for this yet?

Best,

Matt Thomas
@betweenbrain
http://matt-thomas.me/
http://betweenbrain.com/
https://github.com/betweenbrain

Sent from mobile. Please pardon any typos or brevity.
On Jan 7, 2014 7:01 AM, "Piotr" notifications@github.com wrote:

At this moment when using a form field description

with language string

COM_EXAMPLE_DESC="This is important!"

The translation is being escaped in views:

echo '

' . $this->escape(JText::_($fieldSet->description)) . '

';

preventing use HTML tags in the description:
This is important!

However this is not a case for

So I think HTML escaping should be removed for fieldset descriptions.

This allows to be more descriptive, add hyperlinks, images, etc.

You can merge this Pull Request by running

git pull https://github.com/piotr-cz/joomla-cms patch_Description

Or view, comment on, or merge it at:

#2765
Commit Summary

  • Administrator Components
  • Administrator Temlates
  • Site Components

File Changes

Patch Links:


Reply to this email directly or view it on GitHub#2765
.

avatar piotr-cz
piotr-cz - comment - 7 Jan 2014

@betweenbrain Yes, it's the first line in the PR description: Issue tracker item 33089

I've decided to put it on top, as it has been overseen in my previous PR's :smile:

avatar betweenbrain
betweenbrain - comment - 7 Jan 2014

Thanks. I ask as I don't see any tracker link in the email from Github. The
text starts with "At this moment when using a form field description". Will
check it when I get to a desktop.

Best,

Matt Thomas
@betweenbrain
http://matt-thomas.me/
http://betweenbrain.com/
https://github.com/betweenbrain

Sent from mobile. Please pardon any typos or brevity.
On Jan 7, 2014 7:54 AM, "Piotr" notifications@github.com wrote:

@betweenbrain https://github.com/betweenbrain Yes, it's the first line
in the PR description: Issue tracker item 33089
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33089&start=0

I've decided to put it on top, as it has been overseen in my previous PR's [image:
:smile:]


Reply to this email directly or view it on GitHub#2765 (comment)
.

avatar piotr-cz
piotr-cz - comment - 7 Jan 2014

I see. This is because I created a pull request first (you received an email), then tracker item with reference to PR and at the end updated the PR description with issue tracer code.

avatar Bakual
Bakual - comment - 7 Jan 2014

I had a look when this was introduced to see if there was a reason. Commit is 9a6abe4 from 4 years ago, whith message "Merging JForm branch down to trunk".

Imho we can safely remove this escaping. Looks like it has slipped in without any particular reason.

avatar betweenbrain
betweenbrain - comment - 7 Jan 2014

Could it be escape it for security reasons? I had previously demonstrated
to JSST that language files can be exploited.

Best,

Matt Thomas
@betweenbrain https://twitter.com/betweenbrain
http://matt-thomas.me/
http://betweenbrain.com/
https://github.com/betweenbrain

On Tue, Jan 7, 2014 at 8:33 AM, Thomas Hunziker notifications@github.comwrote:

I had a look when this was introduced to see if there was a reason. Commit
is 9a6abe49a6abe4from 4 years ago, whith message "Merging JForm branch down to trunk".

Imho we can safely remove this escaping. Looks like it has slipped in
without any particular reason.


Reply to this email directly or view it on GitHub#2765 (comment)
.

avatar piotr-cz
piotr-cz - comment - 7 Jan 2014

@betweenbrain At this moment Form field labels and descriptions are not being escaped, so this PR doesn't change much in terms of security.

To address the language strings issue I think it's better to escape inline javascript inside the JLanguage package.
Anyway better safe than sorry.

avatar Bakual
Bakual - comment - 7 Jan 2014

I don't think this is about security. If so, then it would have to be applied to all instances. Also it was introduced as part of a bigger commit and not to solve a security issue.

avatar piotr-cz
piotr-cz - comment - 8 Jan 2014

Question: If this is merged to master branch, I'm planning to add a pull request for the 2.5. Are there any objections against it?

avatar piotr-cz piotr-cz - change - 12 May 2014
Title
Remove escaping of Fieldset descriptions.
[#33089] Remove escaping of Fieldset descriptions.
avatar piotr-cz piotr-cz - change - 12 May 2014
Title
Remove escaping of Fieldset descriptions.
[#33089] Remove escaping of Fieldset descriptions.
avatar piotr-cz piotr-cz - close - 12 May 2014
avatar piotr-cz
piotr-cz - comment - 12 May 2014

Okay, seems that I've broken this Pull Request while doing rebase.
I'll close it as it's sitting here for too long and there's no consensus about security.

avatar piotr-cz piotr-cz - change - 12 May 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-05-12 14:08:07
avatar piotr-cz piotr-cz - close - 12 May 2014
avatar piotr-cz piotr-cz - head_ref_deleted - 6 Sep 2014

Add a Comment

Login with GitHub to post a comment