Security Advisories (1)
CVE-2010-3438 (2019-11-12)

libpoe-component-irc-perl before v6.32 does not remove carriage returns and line feeds. This can be used to execute arbitrary IRC commands by passing an argument such as \"some text\\rQUIT\" to the 'privmsg' handler, which would cause the client to disconnect from the server.

NAME

POE::Component::IRC::Test::Plugin - Part of the POE::Component::IRC test-suite.

SYNOPSIS

  use Test::More tests => 16;
  BEGIN { use_ok('POE::Component::IRC') };
  BEGIN { use_ok('POE::Component::IRC::Test::Plugin') };
  use POE;

  my $self = POE::Component::IRC->spawn( );

  isa_ok ( $self, 'POE::Component::IRC' );

  POE::Session->create(
	inline_states => { _start => \&test_start, },
	package_states => [
	  'main' => [ qw(irc_plugin_add irc_plugin_del) ],
	],
  );

  $poe_kernel->run();
  exit 0;

  sub test_start {
    my ($kernel,$heap) = @_[KERNEL,HEAP];

    $self->yield( 'register' => 'all' );

    my $plugin = POE::Component::IRC::Test::Plugin->new();
    isa_ok ( $plugin, 'POE::Component::IRC::Test::Plugin' );
  
    $heap->{counter} = 6;
    unless ( $self->plugin_add( 'TestPlugin' => $plugin ) ) {
	fail( 'plugin_add' );
  	$self->yield( 'unregister' => 'all' );
  	$self->yield( 'shutdown' );
    }

    undef;
  }

  sub irc_plugin_add {
    my ($kernel,$heap,$desc,$plugin) = @_[KERNEL,HEAP,ARG0,ARG1];

    isa_ok ( $plugin, 'POE::Component::IRC::Test::Plugin' );
  
    unless ( $self->plugin_del( 'TestPlugin' ) ) {
  	fail( 'plugin_del' );
  	$self->yield( 'unregister' => 'all' );
  	$self->yield( 'shutdown' );
    }
    undef;
  }

  sub irc_plugin_del {
    my ($kernel,$heap,$desc,$plugin) = @_[KERNEL,HEAP,ARG0,ARG1];

    isa_ok ( $plugin, 'POE::Component::IRC::Test::Plugin' );
    $heap->{counter}--;
    if ( $heap->{counter} <= 0 ) {
      $self->yield( 'unregister' => 'all' );
      $self->yield( 'shutdown' );
    } else {
      unless ( $self->plugin_add( 'TestPlugin' => $plugin ) ) {
	fail( 'plugin_add' );
  	$self->yield( 'unregister' => 'all' );
  	$self->yield( 'shutdown' );
      }
    }
    undef;
  }

DESCRIPTION

POE::Component::IRC::Test::Plugin is a very simple POE::Component::IRC plugin used to test that the plugin system is working correctly, as demonstrated in the SYNOPSIS.

CONSTRUCTOR

new

No arguments required, returns an POE::Component::IRC::Test::Plugin object.

AUTHOR

Chris "BinGOs" Williams

SEE ALSO

POE::Component::IRC