fix part_pkg.comment xss
authorIvan Kohler <ivan@freeside.biz>
Sat, 8 Dec 2012 19:07:04 +0000 (11:07 -0800)
committerIvan Kohler <ivan@freeside.biz>
Sat, 8 Dec 2012 19:07:04 +0000 (11:07 -0800)
httemplate/browse/agent_type.cgi
httemplate/edit/agent_type.cgi

index 1959302..7711dcc 100755 (executable)
@@ -44,9 +44,9 @@ my $agent_type = shift;
          [
            {
              #'data'  => $part_pkg->pkg. ' - '. $part_pkg->comment,
-             'data'  => $type_pkgs->pkg. ' - '.
+             'data'  => encode_entities($type_pkgs->pkg). ' - '.
                         ( $type_pkgs->custom ? '(CUSTOM) ' : '' ).
-                        $type_pkgs->comment,
+                        encode_entities($type_pkgs->comment),
              'align' => 'left',
              'link'  => $p. 'edit/part_pkg.cgi?'. $type_pkgs->pkgpart,
            },
index 8a6fbc2..b75757f 100755 (executable)
@@ -20,7 +20,7 @@ Select which packages agents of this type may sell to customers<BR>
               'source_obj'    => $agent_type,
               'link_table'    => 'type_pkgs',
               'target_table'  => 'part_pkg',
-              'name_callback' => sub { $_[0]->pkg_comment(nopkgpart => 1); },
+              'name_callback' => sub { encode_entities( $_[0]->pkg_comment(nopkgpart => 1) ); },
               'target_link'   => $p.'edit/part_pkg.cgi?',
               'disable-able'  => 1,