[JIRA] (JENKINS-54248) readJSON exposes text data, which could contain secured things

2 views
Skip to first unread message

james.hogarth@gmail.com (JIRA)

unread,
Oct 25, 2018, 7:20:02 AM10/25/18
to jenkinsc...@googlegroups.com
James Hogarth created an issue
 
Jenkins / Bug JENKINS-54248
readJSON exposes text data, which could contain secured things
Issue Type: Bug Bug
Assignee: rsandell
Components: pipeline-utility-steps-plugin
Created: 2018-10-25 11:19
Environment: Jenkins 2.147
Pipeline utility steps 2.1.0
Priority: Major Major
Reporter: James Hogarth

When reading a json string into a dict the details pipeline steps page (flowGraphTable) has the full text passed in as the argument.

In the event that JSON data is gathered using sh (eg via curl or similar) and you want to translate this into a dict with 'readJSON text: foo' the contents of foo are visible in that screen.

Since it's been made clear that JsonSlurperClassic() is not going to be supported to handle the conversion outside of  step - see https://github.com/jenkinsci/script-security-plugin/pull/77 - there really needs to be an option or something to avoid this exposure in the case that the JSON data to turn into a dict requires obfuscation due to secrets involved (or just hide by default).

This is particularly concerning as the console output of course doesn't display the variable data when converting to a dict: def foo = readJSON text: myvar

The blue ocean steps and the details pipeline steps view shows myvar though

Right now I'm working around this by doing:

writeFile(file: 'super_temporary.json', text: my_json)
foo = readJSON file: 'super_temporary.json'
sh 'rm -f super_temporary.json'

 

This obviously requires three steps rather than than a single step, which is a bit of a slow down and makes it messier in the output.

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

chiranth.bagivaluramaswamy@citrix.com (JIRA)

unread,
Jan 7, 2019, 3:51:58 PM1/7/19
to jenkinsc...@googlegroups.com
Chiranth Bagivalu Ramaswamy commented on Bug JENKINS-54248
 
Re: readJSON exposes text data, which could contain secured things

HI, I am facing the same issue. Is there a timeline on the issue if it will be addressed. I tried to mask the whole thing like below but even this didn't help. Any other workarounds apart from having to save it as a file?

wrap([$class: 'MaskPasswordsBuildWrapper', varPasswordPairs:[[password:secureString, var:"secureString"]]])

{ readJSON text: secureString }

chiranth.bagivaluramaswamy@citrix.com (JIRA)

unread,
Jan 7, 2019, 3:52:01 PM1/7/19
to jenkinsc...@googlegroups.com

a.krysko@astoundcommerce.com (JIRA)

unread,
Apr 18, 2019, 8:52:03 AM4/18/19
to jenkinsc...@googlegroups.com

I experience the same on 2.172, would be nice to have this fixed.

a.krysko@astoundcommerce.com (JIRA)

unread,
Apr 18, 2019, 8:52:03 AM4/18/19
to jenkinsc...@googlegroups.com

vlad.fedosov@gmail.com (JIRA)

unread,
Mar 25, 2020, 10:05:04 AM3/25/20
to jenkinsc...@googlegroups.com

Same issue here, in BlueOcean Jenkins ver. 2.204.5

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages