| 1 | package HTML::Form::XSS::Result; | ||||||||||
| 2 | |||||||||||
| 3 | =pod | ||||||||||
| 4 | |||||||||||
| 5 | =head1 NAME | ||||||||||
| 6 | |||||||||||
| 7 | HTML::Form::XSS::Result - Result of XSS HTML form test. | ||||||||||
| 8 | |||||||||||
| 9 | =head1 SYNOPSIS | ||||||||||
| 10 | |||||||||||
| 11 | my $result = HTML::Form::XSS::Result->new( #using are modified result class | ||||||||||
| 12 | form => $form, | ||||||||||
| 13 | names => \@names, | ||||||||||
| 14 | check => '<script>alert(1);</script>' | ||||||||||
| 15 | ); | ||||||||||
| 16 | |||||||||||
| 17 | =head1 DESCRIPTION | ||||||||||
| 18 | |||||||||||
| 19 | Please see <HTML::XSSLint::Result> for details, as this object inherits | ||||||||||
| 20 | all of its functions. | ||||||||||
| 21 | |||||||||||
| 22 | =head1 METHODS | ||||||||||
| 23 | |||||||||||
| 24 | =cut | ||||||||||
| 25 | |||||||||||
| 26 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 27 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 28 | 3 | ▶ | use parent qw(HTML::XSSLint::Result); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 29 | ############################################### | ||||||||||
| 30 | |||||||||||
| 31 | =pod | ||||||||||
| 32 | |||||||||||
| 33 | =head2 example(); | ||||||||||
| 34 | |||||||||||
| 35 | my $exampleUrl $result->example(); | ||||||||||
| 36 | |||||||||||
| 37 | Returns a full URL with query string to get an example for | ||||||||||
| 38 | a vulnerable result. Returns undef if the result is not vulnerable. | ||||||||||
| 39 | |||||||||||
| 40 | =cut | ||||||||||
| 41 | |||||||||||
| 42 | ############################################### | ||||||||||
| 43 | 0 | ▶ | sub example { #we show the actual check that we picked up | ||||||||
|
Subroutine
example: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 44 | 0 | my $self = shift; | |||||||||
| 45 | 0 | ▶ | return undef unless $self->vulnerable; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 46 | 0 | my $uri = URI->new($self->action); | |||||||||
| 47 | 0 | $uri->query_form(map { $_ => $self->_getCheck() } $self->names); | |||||||||
| 48 | 0 | return $uri; | |||||||||
| 49 | } | ||||||||||
| 50 | ############################################## | ||||||||||
| 51 | # | ||||||||||
| 52 | # private methods | ||||||||||
| 53 | # | ||||||||||
| 54 | ############################################## | ||||||||||
| 55 | 0 | ▶ | sub _getCheck{ #accessor | ||||||||
|
Subroutine
_getCheck: not called CC=1 SCAR=6.9
| |||||||||||
| 56 | 0 | my $self = shift; | |||||||||
| 57 | 0 | return $self->{'check'}; | |||||||||
| 58 | } | ||||||||||
| 59 | ############################################## | ||||||||||
| 60 | |||||||||||
| 61 | =pod | ||||||||||
| 62 | |||||||||||
| 63 | =head1 AUTHOR | ||||||||||
| 64 | |||||||||||
| 65 | MacGyveR <dumb@cpan.org> | ||||||||||
| 66 | |||||||||||
| 67 | Development questions, bug reports, and patches are welcome to the above address | ||||||||||
| 68 | |||||||||||
| 69 | =head1 COPYRIGHT | ||||||||||
| 70 | |||||||||||
| 71 | Copyright (c) 2011 MacGyveR. All rights reserved. | ||||||||||
| 72 | |||||||||||
| 73 | This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. | ||||||||||
| 74 | |||||||||||
| 75 | =cut | ||||||||||
| 76 | |||||||||||
| 77 | #################################################### | ||||||||||
| 78 | 3 | return 1; | |||||||||