web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Execution of scripts was prohibited. Use the XsltSettings.EnableScript property to enable it

(0) ShareShare
ReportReport
Posted on by 197

Hi All,

I am facing error as "Execution of scripts was prohibited. Use the XsltSettings.EnableScript property to enable it " while applying tranforms for a data entity in Data Mangement.Debugged the process issue is triggering in the DMFXsltTransform class.

6036.pastedimage1587565193690v1.png

static public void transformFile(DMFLocalFilePath inputFilePath, DMFLocalFilePath outputFilePath, str xsltString)
    {
        System.Xml.XmlUrlResolver resolver;
        System.Xml.Xsl.XsltSettings managedSettings;
        System.Xml.Xsl.XslCompiledTransform managedTransform;
        boolean scriptingEnabled = DMFFlights::DMFXsltEnableScript();   
        managedSettings = new System.Xml.Xsl.XsltSettings(scriptingEnabled, scriptingEnabled);
        resolver = new System.Xml.XmlUrlResolver();

        managedTransform = new System.Xml.Xsl.XslCompiledTransform();
        
        // Initialize reader for the xslt
        using(System.IO.StringReader xsltStringReader = new System.IO.StringReader(xsltString))
        {
            using(System.Xml.XmlReader xsltXmlReader = System.Xml.XmlReader::Create(xsltStringReader))
            {
                // Load xslt
                managedTransform.Load(xsltXmlReader, managedSettings, resolver);

                using(System.Xml.XmlReader inputFileXmlReader = System.Xml.XmlReader::Create(inputFilePath))
                {
                    using(System.Xml.XmlWriter outputWriter = System.Xml.XmlWriter::Create(outputFilePath))
                    {
                        // Transform
                        managedTransform.Transform(inputFileXmlReader, outputWriter);-- facing Issue at this point
                        outputWriter.Flush();
                    }
                }
            }
        }
    }

Can anyone please help me to resolve the issue.

Regards,

Swetha.

I have the same question (0)
  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    What is the value of scriptingEnabled variable?

    By the way, I moved the question here from the AX forum.

  • Sergei Minozhenko Profile Picture
    23,093 on at

    Hi, What version are you using?

    There is new fix fix.lcs.dynamics.com/.../Details

    Potential security vulnerability: XSLT transform running script

    DMFXsltTransform has a method transformFile() in which we are using XsltSettings with ScriptEnabled set to True. Because of this a hacker can put random script in the xml file and let the system run it.

    For me, it sounds like scripts will be disabled anyway.

  • Swetha Molagavalli Profile Picture
    197 on at

    Hi Martin,

    Thank you for moving the question to D365 forum.

    Value for scriptingEnabled variable is false.

    Regards,

    Swetha.

  • Swetha Molagavalli Profile Picture
    197 on at

    Hi Sergei,

    I am using version 10.0.10.

    Is there any chance of enabling the script?

    Regards,

    Swetha.

  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,093 on at

    Hi,

    According to the code above, it's activated by flight DMFXsltEnableScript

    There is also description how to enable flight and some clarification about DMFXsltEnableScript

    docs.microsoft.com/.../data-entities-data-packages

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 611 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans