전문 인터넷 중독자 • 게임 애호가 • 기술 창작자
전문 인터넷 중독자 • 게임 애호가 • 기술 창작자

TransformerFactory를 사용하여 XSL에서 Java 메서드 호출 방지

TransformerFactory를 사용하여 XSL에서 Java 메서드 호출을 거부하거나 허용하지 않는 방법!
이 페이지는 여러분의 편의를 위해 열정적인 AI 인턴들이 영어에서 번역한 것입니다. 아직 학습 중이므로 몇 가지 오류가 있을 수 있습니다. 가장 정확한 정보는 영어 버전을 참조하세요.
블로그 TransformerFactory를 사용하여 XSL에서 Java 메서드 호출 방지

이 블로그 게시물은 2011년 4월에 게시되었으므로, 읽는 시점에 따라 일부 내용이 최신이 아닐 수 있습니다. 안타깝게도 정보의 정확성을 보장하기 위해 게시물을 항상 최신 상태로 유지할 수는 없습니다.

    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.

    Special Agent Squeaky님이 작성했습니다. 최초 게시일 2011년 4월 23일. 최종 업데이트일 2011년 4월 23일.

    📺 스퀴키의 최신 영상을 시청하세요!

    라이브 스트림에 간단한 실시간 자막을 추가하는 방법