Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
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
Description
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.
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Attachment | invalid.json [ 50643 ] |
Assignee | Mark Waite [ markewaite ] |
Component/s | core [ 15593 ] | |
Component/s | git-plugin [ 15543 ] |
Summary | Control chars in Git commit messages cause invalid JSON | Control chars in Git commit messages cause invalid JSON from REST API |
Labels | json serialization stapler |
Thanks for the report. I agree that is a bug. The JSON specification for strings states that:
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.