Security Blog

The latest news and insights from Google on security and safety on the Internet

Reducing XSS by way of Automatic Context-Aware Escaping in Template Systems

31 มีนาคม 2552
Share on Twitter Share on Facebook
Google

9 ความคิดเห็น :

miked กล่าวว่า...

I like django solution - all data substitution are dangerouse, but when you need html you place 'safe' filter, and now you start really thinking safe it or not

1 เมษายน 2552 เวลา 07:49
jwilliams กล่าวว่า...

For some additional background on context sensitive escaping in HTML, check out OWASP's XSS Prevention Cheat Sheet at http://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet. Are there differences with what is recommended there?

2 เมษายน 2552 เวลา 16:32
Jack O'Sullivan กล่าวว่า...

You guys are a little over my head, but you guys are awesome. Thanks for all the info!
Jack O'Sullivan
Bedroom Sets

5 เมษายน 2552 เวลา 23:37
Olivvv กล่าวว่า...

Hi

So you consider that on large applications, the approach of filtering data when it enters the program is not maintainable. Some dev will forget it, and there is no way to test if all the necessary filters are in place, so you put a big bold filter on the output.

It seems efficient at cleaning the output from xss attacks style, but
isn't the remedy worst that the disease ?

If, when it was really necessary devs were forgetting to properly filters inputs, now that there is that filter-on-output system, won't they be even more lazy ?

It seems to me that this approach hardens protection against xss-attacks, and weaken protection against more old school attacks.

olivvv

14 เมษายน 2552 เวลา 06:54
Jad กล่าวว่า...

Thanks all for the good comments and information.

@jwilliams: Thanks for the link to the OWASP document, I hadn't seen it before. The different contexts (represented by the individual rules) in that document align well with the ones we targeted, which is great. There are small differences such as handling content in Javascript outside of string literals, CSS in style tags and perhaps more handling of non-quoted attributes but these are all reconcilable. Note that I didn't review the escaping functions themselves.

@olivvv: We didn't write about input validation here as the blog post was already lengthy. We certainly encourage consistent and strong input validation because it helps to prevent not only XSS bugs but also many other correctness and security problems too. There is no reason you can't have both at the same time (input validation and output escaping). That said, in many cases, input validation alone is not a sufficient defense against XSS.

14 เมษายน 2552 เวลา 18:34
yo กล่าวว่า...

Please roll these changes into the version of clearsilver that is available on appengine:

http://code.google.com/p/googleappengine/issues/detail?id=1363

19 เมษายน 2552 เวลา 14:58
Daira Hopwood กล่าวว่า...

It seems that the inferred filter may be less specific than the actual syntax for the value to be substituted. For instance, the CSS example expects a colour, but the inferred filter will only reject specific unsafe CSS constructs, by the sound of it.

Other than reading the source code, is there any documentation on precisely what each escaping filter does?

20 เมษายน 2552 เวลา 21:19
Swedish Research กล่าวว่า...

Its here the quality work clean of little else is done at Google. Very good blog post.

Escape-sequences cause so much problem and have do it so long. People patching code from different generations, different projekt and so on.

Very usefull.

21 เมษายน 2552 เวลา 21:29
koolo กล่าวว่า...

IF you want to help remove malware then go here..

http://remove-malware.com/

10 พฤษภาคม 2552 เวลา 02:53

แสดงความคิดเห็น

  

ป้ายกำกับ


  • AI Security
  • android
  • android security
  • android tr
  • app security
  • big data
  • biometrics
  • blackhat
  • C++
  • chrome
  • chrome enterprise
  • chrome security
  • connected devices
  • CTF
  • diversity
  • encryption
  • federated learning
  • fuzzing
  • Gboard
  • google play
  • google play protect
  • hacking
  • interoperability
  • iot security
  • kubernetes
  • linux kernel
  • memory safety
  • Open Source
  • pha family highlights
  • pixel
  • privacy
  • private compute core
  • Rowhammer
  • rust
  • Security
  • security rewards program
  • #sharethemicincyber
  • sigstore
  • spyware
  • supply chain
  • #supplychain #security #opensource
  • targeted spyware
  • tensor
  • Titan M2
  • VDP
  • vulnerabilities
  • workshop


Archive


  •     2026
    • เม.ย.
    • มี.ค.
    • ก.พ.
    • ม.ค.
  •     2025
    • ธ.ค.
    • พ.ย.
    • ต.ค.
    • ก.ย.
    • ส.ค.
    • ก.ค.
    • มิ.ย.
    • พ.ค.
    • เม.ย.
    • มี.ค.
    • ก.พ.
    • ม.ค.
  •     2024
    • ธ.ค.
    • พ.ย.
    • ต.ค.
    • ก.ย.
    • ส.ค.
    • ก.ค.
    • มิ.ย.
    • พ.ค.
    • เม.ย.
    • มี.ค.
    • ก.พ.
    • ม.ค.
  •     2023
    • ธ.ค.
    • พ.ย.
    • ต.ค.
    • ก.ย.
    • ส.ค.
    • ก.ค.
    • มิ.ย.
    • พ.ค.
    • เม.ย.
    • มี.ค.
    • ก.พ.
    • ม.ค.
  •     2022
    • ธ.ค.
    • พ.ย.
    • ต.ค.
    • ก.ย.
    • ส.ค.
    • ก.ค.
    • มิ.ย.
    • พ.ค.
    • เม.ย.
    • มี.ค.
    • ก.พ.
    • ม.ค.
  •     2021
    • ธ.ค.
    • พ.ย.
    • ต.ค.
    • ก.ย.
    • ส.ค.
    • ก.ค.
    • มิ.ย.
    • พ.ค.
    • เม.ย.
    • มี.ค.
    • ก.พ.
    • ม.ค.
  •     2020
    • ธ.ค.
    • พ.ย.
    • ต.ค.
    • ก.ย.
    • ส.ค.
    • ก.ค.
    • มิ.ย.
    • พ.ค.
    • เม.ย.
    • มี.ค.
    • ก.พ.
    • ม.ค.
  •     2019
    • ธ.ค.
    • พ.ย.
    • ต.ค.
    • ก.ย.
    • ส.ค.
    • ก.ค.
    • มิ.ย.
    • พ.ค.
    • เม.ย.
    • มี.ค.
    • ก.พ.
    • ม.ค.
  •     2018
    • ธ.ค.
    • พ.ย.
    • ต.ค.
    • ก.ย.
    • ส.ค.
    • ก.ค.
    • มิ.ย.
    • พ.ค.
    • เม.ย.
    • มี.ค.
    • ก.พ.
    • ม.ค.
  •     2017
    • ธ.ค.
    • พ.ย.
    • ต.ค.
    • ก.ย.
    • ก.ค.
    • มิ.ย.
    • พ.ค.
    • เม.ย.
    • มี.ค.
    • ก.พ.
    • ม.ค.
  •     2016
    • ธ.ค.
    • พ.ย.
    • ต.ค.
    • ก.ย.
    • ส.ค.
    • ก.ค.
    • มิ.ย.
    • พ.ค.
    • เม.ย.
    • มี.ค.
    • ก.พ.
    • ม.ค.
  •     2015
    • ธ.ค.
    • พ.ย.
    • ต.ค.
    • ก.ย.
    • ส.ค.
    • ก.ค.
    • มิ.ย.
    • พ.ค.
    • เม.ย.
    • มี.ค.
    • ก.พ.
    • ม.ค.
  •     2014
    • ธ.ค.
    • พ.ย.
    • ต.ค.
    • ก.ย.
    • ส.ค.
    • ก.ค.
    • มิ.ย.
    • เม.ย.
    • มี.ค.
    • ก.พ.
    • ม.ค.
  •     2013
    • ธ.ค.
    • พ.ย.
    • ต.ค.
    • ส.ค.
    • มิ.ย.
    • พ.ค.
    • เม.ย.
    • มี.ค.
    • ก.พ.
    • ม.ค.
  •     2012
    • ธ.ค.
    • ก.ย.
    • ส.ค.
    • มิ.ย.
    • พ.ค.
    • เม.ย.
    • มี.ค.
    • ก.พ.
    • ม.ค.
  •     2011
    • ธ.ค.
    • พ.ย.
    • ต.ค.
    • ก.ย.
    • ส.ค.
    • ก.ค.
    • มิ.ย.
    • พ.ค.
    • เม.ย.
    • มี.ค.
    • ก.พ.
  •     2010
    • พ.ย.
    • ต.ค.
    • ก.ย.
    • ส.ค.
    • ก.ค.
    • พ.ค.
    • เม.ย.
    • มี.ค.
  •     2009
    • พ.ย.
    • ต.ค.
    • ส.ค.
    • ก.ค.
    • มิ.ย.
    • มี.ค.
  •     2008
    • ธ.ค.
    • พ.ย.
    • ต.ค.
    • ส.ค.
    • ก.ค.
    • พ.ค.
    • ก.พ.
  •     2007
    • พ.ย.
    • ต.ค.
    • ก.ย.
    • ก.ค.
    • มิ.ย.
    • พ.ค.

Feed

Follow
Give us feedback in our Product Forums.
  • Google
  • Privacy
  • Terms