This Question is Resolved.

If you have a similiar issue that this thread does not address, click the button below to open a new related support topic.

 
 
Misformatted text…
Posted: 28 November 2008 01:25 PM   [ Ignore ]  
Grad Student
Rank
Total Posts:  83
Joined  04-10-2008

AB&CD;Above, I entered AB then an ampersand then CD.

However, in my EE site it seems to add a trailing semicolon and removing the trailing line break. So, if it does that here too—is there a way to stop that?

(EDIT: yep, did it here too—can that be fixed?)

Profile
 
 
Posted: 28 November 2008 06:09 PM   [ Ignore ]   [ # 1 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  2550
Joined  05-07-2007

Can you please enter your original input in between [ code ] input [/ code ] tags (Get rid of the spaces in the tags)?  Also, what version and build are you running?

 Signature 
Profile
MSG
 
 
Posted: 28 November 2008 06:29 PM   [ Ignore ]   [ # 2 ]  
Grad Student
Rank
Total Posts:  83
Joined  04-10-2008
Greg Aker - 28 November 2008 06:09 PM

Can you please enter your original input in between [ code ] input [/ code ] tags (Get rid of the spaces in the tags)?  Also, what version and build are you running?

Sure, in CODE:

AB&CD;And then a return

And the exact same text, entered in the post:

AB&CD;And then a return

EDIT: it misformats within the CODE block too, just type AB then an ampersand then CD then a return and then some text—you’ll wind up with something different—same happens in this forum.

Profile
 
 
Posted: 28 November 2008 07:06 PM   [ Ignore ]   [ # 3 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  2550
Joined  05-07-2007

Ah, okay.

What version/build are you running?

 Signature 
Profile
MSG
 
 
Posted: 28 November 2008 07:09 PM   [ Ignore ]   [ # 4 ]  
Grad Student
Rank
Total Posts:  83
Joined  04-10-2008

We just upgraded yesterday (thinking it would fix this problem)—but it happens in these forums too—try it, you’ll see!

Profile
 
 
Posted: 29 November 2008 07:36 AM   [ Ignore ]   [ # 5 ]  
Administrator
Avatar
RankRankRankRankRankRank
Total Posts:  6762
Joined  03-23-2006

Unfortunately turnstyle, this is unavoidable.  What you see is a security feature of EE.  In HTML, special characters follow the pattern of &code; (ampersand-code-semicolon).  Special characters without the semicolon are said to be “malformed”.  In some browsers, if you leave off the semicolon you can inject malicious code (ie: hack) and so EE looks for special characters without the semicolon and adds it itself.  So in your case, “&CD” is triggering this.

EE is not able to tell that the text is harmless and intended, as we err on the side of caution.  One way around this is to use spaces, or to code out the full special character for an ampersand, with is &

Does that help out?

 Signature 

DerekAllard.com - CodeIgniter, ExpressionEngine, and the World of Web Design
BambooInvoice - Open Source, CodeIgniter powered invoicing.

Profile
MSG
 
 
Posted: 29 November 2008 07:43 AM   [ Ignore ]   [ # 6 ]  
Grad Student
Rank
Total Posts:  83
Joined  04-10-2008

It just seems a bit over-reactive—for example, is AT&T going to misformat too?

EDIT: Interesting—AT&T is ok, but then what about AT&TT;

Profile
 
 
Posted: 29 November 2008 07:46 AM   [ Ignore ]   [ # 7 ]  
Administrator
Avatar
RankRankRankRankRankRank
Total Posts:  6762
Joined  03-23-2006

There are no known exploits for single character malformed entities, so we allow those.  We try to be as unreactive as possible wink

 Signature 

DerekAllard.com - CodeIgniter, ExpressionEngine, and the World of Web Design
BambooInvoice - Open Source, CodeIgniter powered invoicing.

Profile
MSG
 
 
Posted: 29 November 2008 07:52 AM   [ Ignore ]   [ # 8 ]  
Grad Student
Rank
Total Posts:  83
Joined  04-10-2008
Derek Allard - 29 November 2008 07:46 AM

There are no known exploits for single character malformed entities, so we allow those.  We try to be as unreactive as possible wink

Do you happen to know of any references that shows how a malformed entity exploit might work? The idea is that a malformed HTML entity can force execution of Javascript?

Profile
 
 
Posted: 29 November 2008 08:07 AM   [ Ignore ]   [ # 9 ]  
Grad Student
Rank
Total Posts:  83
Joined  04-10-2008

Is this is?

http://blog.php-security.org/archives/44-PHP-HTML-Entity-Encoder-Heap-Overflow-Vulnerability.html

ie, is it actually more of a server-side PHP problem, rather than a browser-side problem?

If so—if the PHP problem is fixed, would there still be reason to perform this reformat?

Profile
 
 
Posted: 29 November 2008 08:10 AM   [ Ignore ]   [ # 10 ]  
Administrator
Avatar
RankRankRankRankRankRank
Total Posts:  6762
Joined  03-23-2006

There’s been much discussion of this on the net in general, and even on these forums.  I’d prefer to keep the discussion focused on helping you come to a resolution.  Are you able to use one of the recommended workarounds on your site?

 Signature 

DerekAllard.com - CodeIgniter, ExpressionEngine, and the World of Web Design
BambooInvoice - Open Source, CodeIgniter powered invoicing.

Profile
MSG
 
 
Posted: 29 November 2008 08:32 AM   [ Ignore ]   [ # 11 ]  
Grad Student
Rank
Total Posts:  83
Joined  04-10-2008
Derek Allard - 29 November 2008 08:10 AM

There’s been much discussion of this on the net in general, and even on these forums.  I’d prefer to keep the discussion focused on helping you come to a resolution.  Are you able to use one of the recommended workarounds on your site?

I understand that if I were to change the text, then EE won’t reformat it—in this case, my users are entering text that is getting reformatted—and they then brought it to my attention—so I was hoping to find a way to change the behavior.

Can you perhaps indicate whether this behavior is in response to the PHP vulnerability referenced above? My Googling for ‘html entity exploit’ and ‘html entity vulnerability’ mostly pointed me to that.

Profile
 
 
Posted: 29 November 2008 08:40 AM   [ Ignore ]   [ # 12 ]  
Grad Student
Rank
Total Posts:  83
Joined  04-10-2008

One little note: if it *only* added the semicolon, that would be considerably better—as, right now, it also removes any trailing whitespace (spaces or link breaks).

For example, if I want to write rock&roll;EE will then add the semi after ‘roll’ and ALSO eliminate the space before EE—so my sentence looks sloppy—ie, it would be nicer if it just added the semi, and left the whitespace intact—is that perhaps a reasonable tweak?

Profile
 
 
Posted: 29 November 2008 01:23 PM   [ Ignore ]   [ # 13 ]  
Administrator
Avatar
RankRankRankRankRankRank
Total Posts:  6762
Joined  03-23-2006

The vulnerabilities we are protecting against are client side, xss based attacks, not server side, so there is no way to affect changes at the server level.  Here are two threads that may help out.

http://expressionengine.com/forums/viewthread/60053/
http://expressionengine.com/forums/viewthread/67785/

That said let’s see if we can work out a way to both protect your site and its users, and help them do data entry easily.  Would a custom html button that output “&” do the trick?  What about an educational campaign?  Is it only 1 common phrase that’s getting caught?

 Signature 

DerekAllard.com - CodeIgniter, ExpressionEngine, and the World of Web Design
BambooInvoice - Open Source, CodeIgniter powered invoicing.

Profile
MSG
 
 
Posted: 29 November 2008 01:32 PM   [ Ignore ]   [ # 14 ]  
Grad Student
Rank
Total Posts:  83
Joined  04-10-2008

I think, given the circumstance, it would be enough if EE left the trailing whitespace—or just treated such whitespace at it would treat any other whitespace.

Meaning, if I type &blah;and then a return (I entered a return after the blah)—I should then wind up with:

&blah;

and then a return

rather than &blah;and then a return

See what I mean?

Profile
 
 
Posted: 29 November 2008 01:39 PM   [ Ignore ]   [ # 15 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  16398
Joined  06-03-2002

Yes, the whitespace should be preserved; moving this to the bug forum.

 Signature 
Profile
MSG
 
 
Posted: 05 December 2008 04:04 PM   [ Ignore ]   [ # 16 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  16398
Joined  06-03-2002

Fixed for the next release.

 Signature 
Profile
MSG
 
 
 

This Question is Resolved.

If you have a similiar issue that this thread does not address, click the button below to open a new related support topic.

 
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 66389 Total Logged-in Users: 44
Total Topics: 84714 Total Anonymous Users: 18
Total Replies: 454688 Total Guests: 190
Total Posts: 539402    
Members ( View Memberlist )