Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Safe to download and compile .v from evil source ?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Safe to download and compile .v from evil source ?


Chronological Thread 
  • From: Emilio Jesús Gallego Arias <e AT x80.org>
  • To: Timothy Carstens <intoverflow AT gmail.com>
  • Cc: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Safe to download and compile .v from evil source ?
  • Date: Sun, 02 Feb 2020 15:14:45 +0100
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=e AT x80.org; spf=Pass smtp.mailfrom=e AT x80.org; spf=Pass smtp.helo=postmaster AT x80.org
  • Ironport-phdr: 9a23:N3m95RN8HkIBajRkqZ8l6mtUPXoX/o7sNwtQ0KIMzox0Lfn7rarrMEGX3/hxlliBBdydt6sYzbaL+P2xESxYuNDd6StEKMQNHzY+yuwu1zQ6B8CEDUCpZNXLVAcdWPp4aVl+4nugOlJUEsutL3fbo3m18CJAUk6nbVk9Kev6AJPdgNqq3O6u5ZLTfx9IhD2gar9uMRm6twrcutQZjId4Jas8yhTFr3tMdu9LwW9kOU+fkwzz68ut8pNv6Thct+4k+8VdTaj0YqM0QKBCAj87KW41/srrtRfCTQuL+HQRV3gdnwRLDQbY8hz0R4/9vSTmuOVz3imaJtD2QqsvWTu+9adrSQTnhzkBOjUk7WzYkM1wjKZcoBK8uxxyxpPfbY+JOPZieK7WYNUXTndDUMlMTSxMGoOyYZUSAeoGM+ZWoYvyqVgAohSxGQahH//vxiNSi3PqwaE3yeYsHAfb1wIgBdIOt3HUoc36OqcXUOC1yKjIzTLbYP1Sxzj985LQcgs5rv+NR71wdc7RxlcgFwPCllqdtZblPzKP2eQWrmOW6PRvWPmgimMktw19uD+vxt0jioTQgI8e11PK9T1hzYooJtC1S1R3bcC6HJZRrS2WKol7Tt44T211tis21KUKtJ26cSQQyZkqxQTTZvidf4WI/B7uUvuaLy1ii3J/Yr2/gg6/8Ui+xe34Ucm5yFlLoylZntXWsXANzRPT5tCGSvt74EihxS6C2x3Q5+xHO0w4i7TXJp87zrItlJcfrF7PEjL4lUnolKOWc18r+ums6+TpeLXmoZqcOpdqhQzlPaUjmdCzDf4/MggUUGiX4f6826H7/U3lXLVKieU7nbXesJDDPMgUuqq5AxJO3Ys48Ba+DzKm0MwCknUdLVJFfgiHj4nzNF3ULvD4F6T3v1P5rDZuwOzGL/XKC4/WMnXFi/+1fLBh7FBR0gQ3ys936JddC7VHK/X2DBzfrtvdWzI8Mgi1xNHFBc7vzbQxUGaLD6CeB4rIsFaTrrYiC/ncPMkSojmreKtt3OLnkXJswQxVRqKux5ZCMCnkTMQjGF2QZD/XuvlECX0D71guHLSsj0eNA2YKOiSCGpkk7zR+M7qISIfOQof80qzRhGG8BJIEPzkXWGDJKm/hcsC/Y9lJbSuTJsF7lTlVB6jxE8kmzx787QI=
  • Organization: X80 Heavy Industries

Hi Timothy,

Timothy Carstens
<intoverflow AT gmail.com>
writes:

> Suppose a super-intelligent malevolent AI hands me a collection of .v files
> and asks me to compile them.
>
> Is there *any* mechanism built into coqc which could be used by this evil
> oracle to hack my computer? Examples: ability to run shell commands,
> ability to write to disk, ability to detect whether or not a file at an
> arbitrary path exists or is readable, etc.
>
> I *assume* the answer is "no, coqc is safe to run on untrusted .v from
> Internet," but I've been burned by that before (other languages) so I
> thought I'd better ask.
>
> If the answer is "no," has that been the case for a nice long time, or is
> it only recently "no?" (Trying to gauge likelihood of bugs)

In my opinion the is answer is indeed a strong "no"; sadly, Coq wasn't
designed to be used with adversarial `.v` and `.vo` files. Thus, you
need to trust the good faith of the proof sources.

I would also assume that arbitrary code execution is possible from a
`.v` file, indeed you can likely inject code into files such as
`.bashrc`, etc...

Unfortunately I think that making a system such as Coq
adversarial-resistant would require a complete redesign and rewrite, so
this doesn't seem like something that will be attempted soon.

Then, you would have to worry about the OCaml compiler and runtime, tho
I'm not sure OCaml would be the language of choice for such a project.

> Sorry if this question is answered elsewhere; I searched but wasn't sure
> how to phrase the query

Maybe this question should be added to Coq's F.A.Q.

E.



Archive powered by MHonArc 2.6.18.

Top of Page