Dipendente professionista di Internet • Appassionato di giochi • Creatore di tecnologia
Dipendente professionista di Internet • Appassionato di giochi • Creatore di tecnologia

Prevenire le chiamate ai metodi Java da XSL utilizzando TransformerFactory

Come negare o non consentire la chiamata di metodi Java da un XSL utilizzando TransformerFactory!
Questa pagina è stata tradotta dall'inglese dai miei stagisti di intelligenza artificiale, altamente motivati, per vostra comodità. Stanno ancora imparando, quindi potrebbero esserci degli errori. Per informazioni più accurate, consultate la versione inglese.
Casa Blog Prevenire le chiamate ai metodi Java da XSL utilizzando TransformerFactory

Si prega di notare che questo post del blog è stato pubblicato nell'aprile 2011, quindi, a seconda di quando lo si legge, alcune parti potrebbero non essere aggiornate. Purtroppo, non posso sempre mantenere questi post completamente aggiornati per garantire che le informazioni rimangano accurate.

    When using the Java's TransformerFactory to XSL transform XML documents, the XSL document is allowed to call Java methods by default. This however could be a security issue when dealing with third party XSL documents.
    To disallow calling Java methods from the XSD, set the FEATURE_SECURE_PROCESSING feature on the factory:
    TransformerFactory factory = TransformerFactory.newInstance(); factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
    This will result in an TransformerException when transforming the documents:
    Error: Use of the extension function 'java:new' is not allowed when the secure processing feature is set to true. Error during transformation javax.xml.transform.TransformerException: java.lang.RuntimeException: Use of the extension function 'java:new' is not allowed when the secure processing feature is set to true.

    Scritto da Special Agent Squeaky. Prima pubblicazione 23/04/2011. Ultimo aggiornamento 23/04/2011.

    📺 Guarda l'ultimo video di Squeaky!

    Come aggiungere sottotitoli in tempo reale semplici al tuo streaming in diretta.