{"action":"created","issue":{"url":"https://api.github.com/repos/FasterXML/jackson-databind/issues/1324","repository_url":"https://api.github.com/repos/FasterXML/jackson-databind","labels_url":"https://api.github.com/repos/FasterXML/jackson-databind/issues/1324/labels{/name}","comments_url":"https://api.github.com/repos/FasterXML/jackson-databind/issues/1324/comments","events_url":"https://api.github.com/repos/FasterXML/jackson-databind/issues/1324/events","html_url":"https://github.com/FasterXML/jackson-databind/issues/1324","id":169575476,"number":1324,"title":"Boolean parsing with StdDeserializer is too slow with specific value","user":{"login":"pavankumar-parankusam","id":20856713,"avatar_url":"https://avatars.githubusercontent.com/u/20856713?v=3","gravatar_id":"","url":"https://api.github.com/users/pavankumar-parankusam","html_url":"https://github.com/pavankumar-parankusam","followers_url":"https://api.github.com/users/pavankumar-parankusam/followers","following_url":"https://api.github.com/users/pavankumar-parankusam/following{/other_user}","gists_url":"https://api.github.com/users/pavankumar-parankusam/gists{/gist_id}","starred_url":"https://api.github.com/users/pavankumar-parankusam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavankumar-parankusam/subscriptions","organizations_url":"https://api.github.com/users/pavankumar-parankusam/orgs","repos_url":"https://api.github.com/users/pavankumar-parankusam/repos","events_url":"https://api.github.com/users/pavankumar-parankusam/events{/privacy}","received_events_url":"https://api.github.com/users/pavankumar-parankusam/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-08-05T10:10:55Z","updated_at":"2016-09-29T14:28:20Z","closed_at":null,"body":"JSON Version 2.6.5 and later\r\n\r\nWe tried a use case to provide a big chunk of numbers to the boolean value in JSON.\r\nEg. \r\n{\r\n  isRead: 1010101010101010101010101010101010101010101010101010101010101010101 //(big chunk of numbers, length of 97000 digits, truncated for readibility)\r\n}\r\n\r\nThis takes a lot more time to parse isRead value to boolean datatype. \r\nThe problem is when it tries to determine the JsonParser.getNumberType() in method StdDeserializer._parseBoolean.\r\n\r\nThe JsonParser.getNumberType() calls ends up in ParserBase._parseSlowInt where it create a BigInteger object with provided value. This BigInteger creation takes a long time to parse a numbers of length 97000 digits.\r\n\r\nThis big integer object is created just to detect the valid number type and it is discarded.\r\nFor a boolean parsing, can we not be more strict and say the length of the digits should be only 1.\r\nThen we can avoid all this heavy parsing of value with BigInteger.\r\n\r\nAs the parsing takes more than 10 seconds, we end up in Denial of Service situation. \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/FasterXML/jackson-databind/issues/comments/250482456","html_url":"https://github.com/FasterXML/jackson-databind/issues/1324#issuecomment-250482456","issue_url":"https://api.github.com/repos/FasterXML/jackson-databind/issues/1324","id":250482456,"user":{"login":"cowtowncoder","id":55065,"avatar_url":"https://avatars.githubusercontent.com/u/55065?v=3","gravatar_id":"","url":"https://api.github.com/users/cowtowncoder","html_url":"https://github.com/cowtowncoder","followers_url":"https://api.github.com/users/cowtowncoder/followers","following_url":"https://api.github.com/users/cowtowncoder/following{/other_user}","gists_url":"https://api.github.com/users/cowtowncoder/gists{/gist_id}","starred_url":"https://api.github.com/users/cowtowncoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cowtowncoder/subscriptions","organizations_url":"https://api.github.com/users/cowtowncoder/orgs","repos_url":"https://api.github.com/users/cowtowncoder/repos","events_url":"https://api.github.com/users/cowtowncoder/events{/privacy}","received_events_url":"https://api.github.com/users/cowtowncoder/received_events","type":"User","site_admin":false},"created_at":"2016-09-29T14:28:20Z","updated_at":"2016-09-29T14:28:20Z","body":"No, haven't had time to work on this."}}
{"actor":{"display_login":"cowtowncoder"}}