You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Seth Falcon (JIRA)" <ji...@apache.org> on 2011/01/20 01:19:43 UTC

[jira] Created: (COUCHDB-1031) Able to PUT a JSON document containing invalid UTF-8 characters

Able to PUT a JSON document containing invalid UTF-8 characters
---------------------------------------------------------------

                 Key: COUCHDB-1031
                 URL: https://issues.apache.org/jira/browse/COUCHDB-1031
             Project: CouchDB
          Issue Type: Bug
    Affects Versions: 1.0.1
            Reporter: Seth Falcon


It is possible to create a document (via curl) containing invalid UTF-8.  The document is created, but cannot be retrieved.

I will attach an example bad JSON file to this ticket.  The repro steps are as follows:

couchdb - Apache CouchDB 1.0.1 (from homebrew on OSX)
Erlang 14B

curl -is -X PUT http://localhost:5984/bad-json/bad --data-binary @bad.json 
HTTP/1.1 100 Continue

HTTP/1.1 201 Created
Server: CouchDB/1.0.1 (Erlang OTP/R14B)
Location: http://localhost:5984/bad-json/bad
Etag: "1-0167e886a8795380afc0d3de8922a576"
Date: Thu, 20 Jan 2011 00:16:21 GMT
Content-Type: text/plain;charset=utf-8
Content-Length: 66
Cache-Control: must-revalidate

{"ok":true,"id":"bad","rev":"1-0167e886a8795380afc0d3de8922a576"}


curl -is http://localhost:5984/bad-json/bad
HTTP/1.1 500 Internal Server Error
Server: CouchDB/1.0.1 (Erlang OTP/R14B)
Date: Thu, 20 Jan 2011 00:16:57 GMT
Content-Type: text/plain;charset=utf-8
Content-Length: 53
Cache-Control: must-revalidate

{"error":"ucs","reason":"{bad_utf8_character_code}"}




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-1031) Able to PUT a JSON document containing invalid UTF-8 characters

Posted by "Paul Joseph Davis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-1031?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12983989#action_12983989 ] 

Paul Joseph Davis commented on COUCHDB-1031:
--------------------------------------------

Damn. I have to give Adam a bit of credit cause it did get backported to 0.11.x but missed 1.0.x somehow.

Either way, it'll be in 1.0.2 which I'm about to call a vote for.

> Able to PUT a JSON document containing invalid UTF-8 characters
> ---------------------------------------------------------------
>
>                 Key: COUCHDB-1031
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1031
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 1.0.1
>            Reporter: Seth Falcon
>         Attachments: bad.json, smallbad.json
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> It is possible to create a document (via curl) containing invalid UTF-8.  The document is created, but cannot be retrieved.
> I will attach an example bad JSON file to this ticket.  The repro steps are as follows:
> couchdb - Apache CouchDB 1.0.1 (from homebrew on OSX)
> Erlang 14B
> curl -is -X PUT http://localhost:5984/bad-json/bad --data-binary @bad.json 
> HTTP/1.1 100 Continue
> HTTP/1.1 201 Created
> Server: CouchDB/1.0.1 (Erlang OTP/R14B)
> Location: http://localhost:5984/bad-json/bad
> Etag: "1-0167e886a8795380afc0d3de8922a576"
> Date: Thu, 20 Jan 2011 00:16:21 GMT
> Content-Type: text/plain;charset=utf-8
> Content-Length: 66
> Cache-Control: must-revalidate
> {"ok":true,"id":"bad","rev":"1-0167e886a8795380afc0d3de8922a576"}
> curl -is http://localhost:5984/bad-json/bad
> HTTP/1.1 500 Internal Server Error
> Server: CouchDB/1.0.1 (Erlang OTP/R14B)
> Date: Thu, 20 Jan 2011 00:16:57 GMT
> Content-Type: text/plain;charset=utf-8
> Content-Length: 53
> Cache-Control: must-revalidate
> {"error":"ucs","reason":"{bad_utf8_character_code}"}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (COUCHDB-1031) Able to PUT a JSON document containing invalid UTF-8 characters

Posted by "Paul Joseph Davis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-1031?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Joseph Davis resolved COUCHDB-1031.
----------------------------------------

    Resolution: Duplicate

This is a duplicate of COUCHDB-875 which has already been fixed. Luckily I remembered this even though someone who will remain anonymous (Adam Kocoloski) forgot to backport this change.

This will make it to 1.0.2 which I'm just this moment going to restart preparing.

> Able to PUT a JSON document containing invalid UTF-8 characters
> ---------------------------------------------------------------
>
>                 Key: COUCHDB-1031
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1031
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 1.0.1
>            Reporter: Seth Falcon
>         Attachments: bad.json, smallbad.json
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> It is possible to create a document (via curl) containing invalid UTF-8.  The document is created, but cannot be retrieved.
> I will attach an example bad JSON file to this ticket.  The repro steps are as follows:
> couchdb - Apache CouchDB 1.0.1 (from homebrew on OSX)
> Erlang 14B
> curl -is -X PUT http://localhost:5984/bad-json/bad --data-binary @bad.json 
> HTTP/1.1 100 Continue
> HTTP/1.1 201 Created
> Server: CouchDB/1.0.1 (Erlang OTP/R14B)
> Location: http://localhost:5984/bad-json/bad
> Etag: "1-0167e886a8795380afc0d3de8922a576"
> Date: Thu, 20 Jan 2011 00:16:21 GMT
> Content-Type: text/plain;charset=utf-8
> Content-Length: 66
> Cache-Control: must-revalidate
> {"ok":true,"id":"bad","rev":"1-0167e886a8795380afc0d3de8922a576"}
> curl -is http://localhost:5984/bad-json/bad
> HTTP/1.1 500 Internal Server Error
> Server: CouchDB/1.0.1 (Erlang OTP/R14B)
> Date: Thu, 20 Jan 2011 00:16:57 GMT
> Content-Type: text/plain;charset=utf-8
> Content-Length: 53
> Cache-Control: must-revalidate
> {"error":"ucs","reason":"{bad_utf8_character_code}"}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-1031) Able to PUT a JSON document containing invalid UTF-8 characters

Posted by "Seth Falcon (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-1031?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Seth Falcon updated COUCHDB-1031:
---------------------------------

    Attachment: bad.json

> Able to PUT a JSON document containing invalid UTF-8 characters
> ---------------------------------------------------------------
>
>                 Key: COUCHDB-1031
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1031
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 1.0.1
>            Reporter: Seth Falcon
>         Attachments: bad.json
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> It is possible to create a document (via curl) containing invalid UTF-8.  The document is created, but cannot be retrieved.
> I will attach an example bad JSON file to this ticket.  The repro steps are as follows:
> couchdb - Apache CouchDB 1.0.1 (from homebrew on OSX)
> Erlang 14B
> curl -is -X PUT http://localhost:5984/bad-json/bad --data-binary @bad.json 
> HTTP/1.1 100 Continue
> HTTP/1.1 201 Created
> Server: CouchDB/1.0.1 (Erlang OTP/R14B)
> Location: http://localhost:5984/bad-json/bad
> Etag: "1-0167e886a8795380afc0d3de8922a576"
> Date: Thu, 20 Jan 2011 00:16:21 GMT
> Content-Type: text/plain;charset=utf-8
> Content-Length: 66
> Cache-Control: must-revalidate
> {"ok":true,"id":"bad","rev":"1-0167e886a8795380afc0d3de8922a576"}
> curl -is http://localhost:5984/bad-json/bad
> HTTP/1.1 500 Internal Server Error
> Server: CouchDB/1.0.1 (Erlang OTP/R14B)
> Date: Thu, 20 Jan 2011 00:16:57 GMT
> Content-Type: text/plain;charset=utf-8
> Content-Length: 53
> Cache-Control: must-revalidate
> {"error":"ucs","reason":"{bad_utf8_character_code}"}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-1031) Able to PUT a JSON document containing invalid UTF-8 characters

Posted by "Seth Falcon (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-1031?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Seth Falcon updated COUCHDB-1031:
---------------------------------

    Attachment: smallbad.json

Here's a shorter example that reproduces it.

> Able to PUT a JSON document containing invalid UTF-8 characters
> ---------------------------------------------------------------
>
>                 Key: COUCHDB-1031
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1031
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 1.0.1
>            Reporter: Seth Falcon
>         Attachments: bad.json, smallbad.json
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> It is possible to create a document (via curl) containing invalid UTF-8.  The document is created, but cannot be retrieved.
> I will attach an example bad JSON file to this ticket.  The repro steps are as follows:
> couchdb - Apache CouchDB 1.0.1 (from homebrew on OSX)
> Erlang 14B
> curl -is -X PUT http://localhost:5984/bad-json/bad --data-binary @bad.json 
> HTTP/1.1 100 Continue
> HTTP/1.1 201 Created
> Server: CouchDB/1.0.1 (Erlang OTP/R14B)
> Location: http://localhost:5984/bad-json/bad
> Etag: "1-0167e886a8795380afc0d3de8922a576"
> Date: Thu, 20 Jan 2011 00:16:21 GMT
> Content-Type: text/plain;charset=utf-8
> Content-Length: 66
> Cache-Control: must-revalidate
> {"ok":true,"id":"bad","rev":"1-0167e886a8795380afc0d3de8922a576"}
> curl -is http://localhost:5984/bad-json/bad
> HTTP/1.1 500 Internal Server Error
> Server: CouchDB/1.0.1 (Erlang OTP/R14B)
> Date: Thu, 20 Jan 2011 00:16:57 GMT
> Content-Type: text/plain;charset=utf-8
> Content-Length: 53
> Cache-Control: must-revalidate
> {"error":"ucs","reason":"{bad_utf8_character_code}"}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-1031) Able to PUT a JSON document containing invalid UTF-8 characters

Posted by "Seth Falcon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-1031?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12983953#action_12983953 ] 

Seth Falcon commented on COUCHDB-1031:
--------------------------------------

You can manufacture bad json documents via Ruby as follows:

Create a gzip of a text file, foo.gz.
In irb do:

require 'json'
h = { "stuff" => IO.read("foo.gz")}
open("foo.json", "w") { |f| f.write(h) }



> Able to PUT a JSON document containing invalid UTF-8 characters
> ---------------------------------------------------------------
>
>                 Key: COUCHDB-1031
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1031
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 1.0.1
>            Reporter: Seth Falcon
>         Attachments: bad.json, smallbad.json
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> It is possible to create a document (via curl) containing invalid UTF-8.  The document is created, but cannot be retrieved.
> I will attach an example bad JSON file to this ticket.  The repro steps are as follows:
> couchdb - Apache CouchDB 1.0.1 (from homebrew on OSX)
> Erlang 14B
> curl -is -X PUT http://localhost:5984/bad-json/bad --data-binary @bad.json 
> HTTP/1.1 100 Continue
> HTTP/1.1 201 Created
> Server: CouchDB/1.0.1 (Erlang OTP/R14B)
> Location: http://localhost:5984/bad-json/bad
> Etag: "1-0167e886a8795380afc0d3de8922a576"
> Date: Thu, 20 Jan 2011 00:16:21 GMT
> Content-Type: text/plain;charset=utf-8
> Content-Length: 66
> Cache-Control: must-revalidate
> {"ok":true,"id":"bad","rev":"1-0167e886a8795380afc0d3de8922a576"}
> curl -is http://localhost:5984/bad-json/bad
> HTTP/1.1 500 Internal Server Error
> Server: CouchDB/1.0.1 (Erlang OTP/R14B)
> Date: Thu, 20 Jan 2011 00:16:57 GMT
> Content-Type: text/plain;charset=utf-8
> Content-Length: 53
> Cache-Control: must-revalidate
> {"error":"ucs","reason":"{bad_utf8_character_code}"}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.