12

I had some Mathematica files on over which recently I have faced to this message:

This file contains potentially unsafe dynamic content.  More Details >>

However, after searching, I have seen some blogs in Mathematica SE or in somewhere else about that, but I could not finally briefly conclude that whether, my files, because of their saving local disk positions (for example, pc Desktop) potentialy or probably maybe be on exposure to attacks or something else caused by viruses or spies (and this possibility will be removed by replacement of the files, or applying bit changes); or not and surely and definitely, they are being attacked or had been attacked.

chris
  • 22,860
  • 5
  • 60
  • 149
Unbelievable
  • 4,847
  • 1
  • 20
  • 46
  • 1
    From where did you download these files? – J. M.'s missing motivation Jul 10 '15 at 05:49
  • 2
    Related: http://mathematica.stackexchange.com/q/29364, http://mathematica.stackexchange.com/q/38799 – Michael E2 Jul 10 '15 at 05:51
  • 1
    @guess who it is, They are my own files. I have not downloaded from any where. I have written them myself however they are not so important! – Unbelievable Jul 10 '15 at 05:57
  • @Michael E2, Thanks for your link, I had seen that previously. But I did not see any dangerous,code, same as that on this link on my computer to run it. I have seen this message over on my own file. – Unbelievable Jul 10 '15 at 06:01
  • Yes, I read it. But I did not expect that I see this massage on my own code, my interpretation, of that was: another files are active and I was worried about that. Although, my question is remained that why after one month from putting my files on untrusted path, mathematica warned me. – Unbelievable Jul 10 '15 at 06:51
  • @mr.0093 This error prompts when you open such file, not when you are saving them. – Kuba Jul 10 '15 at 07:02
  • 2
    What this message means: Any notebook containing Dynamic stuff is potentially dangerous. That's because when you open such a notebook, code might be automatically run without user interaction. Someone could send you a notebook that will automatically delete all files from your hard drive when you open it. Mathematica does not know who created a notebook, so it displays the warning whether it's your notebook or a foreign one that you opened. There's a the "trusted path" functionality (see answer) to ameliorate this inconvenience. – Szabolcs Jul 10 '15 at 07:05
  • @Kuba, and@Szabolcs, Actually, As long as I had changed my codes and had written them, I have saved all of them on my Desktop. Yesterday, I just opened the last one (previously myself changed), when I saw the message, I did not run that and I have searched what happened. – Unbelievable Jul 10 '15 at 07:12
  • Reminds me of Dodgeball. "I thought those were just warnings!" – corsiKa Jul 10 '15 at 16:45

1 Answers1

22

Presumably your Notebooks are not being saved in a Trusted Path. Start by reading the tutorial Notebook Security, and note:

  • If the notebook's directory is trusted, the notebook will be allowed to automatically perform dynamic evaluations without alerting the user.

  • If the notebook's directory is untrusted, the user will be alerted upon any attempt by the notebook to perform dynamic evaluations.

  • By default, the TrustedPath option value contains [$InstallationDirectory](http://reference.wolfram.com/language/ref/$InstallationDirectory.html), [`$BaseDirectory](http://reference.wolfram.com/language/ref/$BaseDirectory.html), and [$UserBaseDirectory`](http://reference.wolfram.com/language/ref/$UserBaseDirectory.html) so that Wolfram System installation files and additional installed applications will be able to display dynamic content without alerting the user.

The tutorial also covers how to add a directory to this path. Run this code and click the button produced:

Button["Edit TrustedPath...", 
  FEPrivate`OptionDialog[$FrontEnd, 
    {"NotebookSecurityOptions", "TrustedPath"}], 
  Appearance -> {Automatic, "DialogBox"},
  Evaluator -> Automatic, Method -> "Preemptive"]

Or see: How to add a trusted path in Mathematica?

Mr.Wizard
  • 271,378
  • 34
  • 587
  • 1,371