CGI

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

      - Content-Disposition name/filename were found inside other
        parameters' quoted values
      - boundaries over the RFC 2046 limit corrupted and merged parts
    - other:
      - CVE-2026-120641: client supplied upload filenames could contain a
        path, allowing path traversal in applications that use them to save
        the file
      - CVE-2026-120640: clients could set POSTDATA/PUTDATA/PATCHDATA/
        XForms:Model through the query string or a form field,
        indistinguishable from the real body (e.g. a cross site HTML form
        posting to a JSON endpoint)
      - CVE-2026-120642: under taint mode the upload filename, uploadInfo()
        values, path_info, Accept(), and some cookie and url_param values
        were untainted
      - CVE-2026-120637: an unrecognised REQUEST_METHOD (e.g. OPTIONS) made
        the process' own command line arguments the request params

    [ BREAKING CHANGES ]
    - X-Forwarded-Host is no longer used by url()/self_url()/virtual_host()
      /virtual_port(), and Host is only used if it is a valid host[:port].
      behind a reverse proxy pass the right Host / SERVER_NAME, or set

t/carp_warnings_reset.t  view on Meta::CPAN

    close STDOUT;
    return $out;
}

for my $reset (
    [ 'CGI::initialize_globals' => sub { CGI::initialize_globals() } ],
    [ 'CGI::_reset_globals'     => sub { CGI->_reset_globals } ], # CGI::Fast
) {
    my ( $name, $reset_sub ) = @$reset;

    # request A: e.g. a JSON endpoint that never calls warningsToBrowser
    $reset_sub->();
    my $a_out = request( code => sub {
        print "Content-Type: application/json\r\n\r\n{}";
        warn "secret for alice\n";
    } );
    unlike( $a_out, qr/secret for alice/, "$name: request A's warning is buffered, not printed" );

    # request B: an HTML page that does call warningsToBrowser
    $reset_sub->();
    my $b_out = request( code => sub {

t/reserved_params.t  view on Meta::CPAN

#!perl

# POSTDATA, PUTDATA, PATCHDATA and XForms:Model hold the raw request body
# (or XForms model) - a client must not be able to set them through the
# query string, a form field or a multipart/related part, as an app could
# then not tell attacker supplied values from the real body (e.g. a plain
# HTML form posting POSTDATA={"admin":true} to a JSON endpoint)

use strict;
use warnings;

use Test::More;
use CGI;

$CGI::LIST_CONTEXT_WARN = 0;

my @reserved = ( 'POSTDATA', 'PUTDATA', 'PATCHDATA', 'XForms:Model' );



( run in 2.005 seconds using v1.01-cache-2.11-cpan-99fa8243a42 )