edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Kevin Carhart <kevin@carhart.net>
To: Edbrowse-dev@lists.the-brannons.com
Subject: [Edbrowse-dev] bad byte in NASA's vendor.js
Date: Thu, 29 Dec 2016 17:30:00 -0800 (PST)	[thread overview]
Message-ID: <alpine.LRH.2.03.1612291703430.7749@carhart.net> (raw)

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1475 bytes --]


Wow!  I found something that can cause JS to crash, yet is more to do 
with our retrieval of javascript code files as large ascii files, rather 
than javascript-the-language.  It happens in nasa.gov and may be one 
reason why nasa.gov stopped working.

I was looking at all of the files successfully downloaded by curl as it 
tries to render nasa.gov, but when the run is still proceeding and has not 
yet aborted (assuming db5 is on).

One of these files is:
https://www.nasa.gov/sites/all/themes/custom/nasatwo/js/vendor.js?oinn2s

Now let's say you make a test html file that will load only vendor.js.
If you go to edbrowse and load this test file with db5, it says this:
vendor.js line 89049: SyntaxError: missing ) after condition

The bad line is like:
if (!d.isValid() || !that.get('value')) {


I played around with the bad line, and found that the syntax error is 
coming from an invisible character!

So the following bytes can make the javascript processing of vendor.js 
fail, screwing things up downstream.

64
28
29
20
7C
7C
A0

The 7C 7C is the "OR" double pipe symbols.  So if you change A0 to a 
regular space, the syntax error goes away.

64
28
29
20
7C
7C
20

How about that!  So is this something we can deal with someplace way more 
low-level than in parsing javascript code itself, such as in http.c when 
the bytes are retrieved?

Will nasa.gov come back when we address this?  Don't know yet, but this is 
definitely a necessary precondition.

Kevin

             reply	other threads:[~2016-12-30  1:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-30  1:30 Kevin Carhart [this message]
2016-12-30  2:11 ` Chris Brannon
2016-12-30  3:24   ` Karl Dahlke
2016-12-30 18:52     ` Chris Brannon
2016-12-30 19:58       ` Karl Dahlke
2016-12-30 20:07         ` Chris Brannon
2016-12-30 23:13           ` Karl Dahlke
2016-12-31  5:28             ` Kevin Carhart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LRH.2.03.1612291703430.7749@carhart.net \
    --to=kevin@carhart.net \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).