Page 1 of 1

security error trying to convert jpg to pdf

Posted: 2019-06-28T13:28:42-07:00
by shochatd
I attempted to perform what I thought was a very straightforward conversion using the command:
convert Deluge1.jpg Deluge1.pdf
I got the following error message:
convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408.
I'm sure I've done this in the past without error. And I have no idea why there would be any security issue here.

Re: security error trying to convert jpg to pdf

Posted: 2019-06-28T13:32:51-07:00
by fmw42
What is your IM version and platform? Where did ImageMagick come from? How was it installed. Please see the policy.xml file for security related permissions and arguments. https://imagemagick.org/script/resources.php

Re: security error trying to convert jpg to pdf

Posted: 2019-06-28T13:46:51-07:00
by shochatd
This is on Ubuntu 19.04. dpkg -l imagemagick says:
||/ Name Version Architecture Description
+++-==============-===========================-============-=======================================
ii imagemagick 8:6.9.10.14+dfsg-7ubuntu2.2 amd64 image manipulation programs -- binaries
I've had this on my system for years. I suppose this version was installed from a routine software update.
In policy.xml I see 2 possible culprits:
1.

Code: Select all

 <!-- <policy domain="module" rights="none" pattern="{PS,PDF,XPS}" /> -->
2.

Code: Select all

  <!-- disable ghostscript format types -->
  <policy domain="coder" rights="none" pattern="PS" />
  <policy domain="coder" rights="none" pattern="EPS" />
  <policy domain="coder" rights="none" pattern="PDF" />
  <policy domain="coder" rights="none" pattern="XPS" />
I don't get what the rationale for this could be.

Re: security error trying to convert jpg to pdf

Posted: 2019-06-28T15:56:02-07:00
by fmw42
The default policy precludes you from reading/writing PDF, etc. This was due to a security bug in Ghostscript, which has now been fixed. I suggest you uncomment those policies and make them rights="read|write. See if that helps.

Re: security error trying to convert jpg to pdf

Posted: 2019-06-28T16:03:34-07:00
by shochatd
Thanks. I had found some documentation about the ghostscript issue but I did not know that it had been fixed. I realized that my "culprit 1" was already commented out, so I tried simply commenting out the 2nd to last policy line (the one mentioning PDF) and that solved the problem.
-- David

Re: security error trying to convert jpg to pdf

Posted: 2019-06-28T16:14:13-07:00
by fmw42
It is fixed in the current 9.27 version of GS, but that version has other bugs as does 9.26

Re: security error trying to convert jpg to pdf

Posted: 2019-06-28T16:35:54-07:00
by shochatd
I'm at 9.26. I guess that's why those policy lines are in the current copy of policy.xml on my system.