New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 795465 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
not working at Google anymore
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

CrossSiteDocumentClassifier::SniffForJSON returns true for some valid JS programs

Project Member Reported by nick@chromium.org, Dec 16 2017

Issue description

The following program is valid JS, but CrossSiteDocumentClassifier::SniffForJSON will classify it as JSON:

{":";
 console.log("hello world");
}

This can be fixed by teaching SniffForJSON to listen for the closing string character.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Dec 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9519547cc96c7e6dfb938a9baf8781e9475f78c4

commit 9519547cc96c7e6dfb938a9baf8781e9475f78c4
Author: Nick Carter <nick@chromium.org>
Date: Wed Dec 20 01:06:37 2017

Improvements to CrossSiteDocumentClassifier::SniffForJSON

 - Understand escape sequences inside of strings
 - Don't support single-quotes
 - The colon character must appear after the closing quote of the string
   literal.

Bug:  795467 ,  795465 
Change-Id: If63188ba6f90b88b274543c8e1f678ef703edf85
Reviewed-on: https://chromium-review.googlesource.com/834408
Commit-Queue: Nick Carter <nick@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#525210}
[modify] https://crrev.com/9519547cc96c7e6dfb938a9baf8781e9475f78c4/content/common/cross_site_document_classifier.cc
[modify] https://crrev.com/9519547cc96c7e6dfb938a9baf8781e9475f78c4/content/common/cross_site_document_classifier_unittest.cc

Comment 2 by nick@chromium.org, Dec 20 2017

Status: Fixed (was: Assigned)

Sign in to add a comment