[JIRA] (JENKINS-61428) Control chars in Git commit messages cause invalid JSON

13 views
Skip to first unread message

drug.knight@gmail.com (JIRA)

unread,
Mar 11, 2020, 8:28:03 AM3/11/20
to jenkinsc...@googlegroups.com
Evgeny Boloboshkin updated an issue
 
Jenkins / Bug JENKINS-61428
Control chars in Git commit messages cause invalid JSON
Change By: Evgeny Boloboshkin
Attachment: invalid.json
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

drug.knight@gmail.com (JIRA)

unread,
Mar 11, 2020, 8:28:03 AM3/11/20
to jenkinsc...@googlegroups.com
Evgeny Boloboshkin created an issue
Issue Type: Bug Bug
Assignee: Mark Waite
Attachments: invalid.json
Components: git-plugin
Created: 2020-03-11 12:27
Environment: Jenkins version: 2.199
Git plugin version: 3.12.1
OS version: CentOS 7 (3.10.0-1062.1.2.el7.x86_64)
Java version: 1.8.0_121
no Tomcat, no reverse proxy
Priority: Major Major
Reporter: Evgeny Boloboshkin

Jenkins generates invalid JSON on http://.../api/json url due to Git commit messages are included in changeset comment attribute as is (the control chars like \x00-\x1F are not filtered).

The excerpt of JSON structure is attached.

mark.earl.waite@gmail.com (JIRA)

unread,
Mar 11, 2020, 8:41:05 AM3/11/20
to jenkinsc...@googlegroups.com
Mark Waite commented on Bug JENKINS-61428
 
Re: Control chars in Git commit messages cause invalid JSON

Thanks for the report. I agree that is a bug. The JSON specification for strings states that:

All Unicode characters may be placed within the quotation marks, except for the characters that MUST be escaped: quotation mark, reverse solidus, and the control characters (U+0000 through U+001F).

The example you provided shows a "control-A" character that should be escaped but is not escaped. I believe that character should have been represented as \u0001 instead.

mark.earl.waite@gmail.com (JIRA)

unread,
Mar 11, 2020, 8:41:05 AM3/11/20
to jenkinsc...@googlegroups.com
Mark Waite assigned an issue to Unassigned
 
Change By: Mark Waite
Assignee: Mark Waite

mark.earl.waite@gmail.com (JIRA)

unread,
Mar 11, 2020, 11:14:03 AM3/11/20
to jenkinsc...@googlegroups.com
 
Re: Control chars in Git commit messages cause invalid JSON

I believe this is an issue in Jenkins core rather than a specific issue in the git plugin.

mark.earl.waite@gmail.com (JIRA)

unread,
Mar 11, 2020, 11:14:04 AM3/11/20
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
 
Change By: Mark Waite
Component/s: core
Component/s: git-plugin
Reply all
Reply to author
Forward
0 new messages