~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to src/pl/plperl/sql/plperl_elog.sql

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-02-05 18:13:52 UTC
  • mfrom: (1.1.10) (10.1.5 oneiric-proposed)
  • Revision ID: package-import@ubuntu.com-20130205181352-3kw4f94ilqklzm7c
Tags: 9.1.8-0ubuntu11.10
* New upstream security/bug fix release: (LP: #1116336)
  - Prevent execution of enum_recv from SQL
    The function was misdeclared, allowing a simple SQL command to crash the
    server.  In principle an attacker might be able to use it to examine the
    contents of server memory.  Our thanks to Sumit Soni (via Secunia SVCRP)
    for reporting this issue. (CVE-2013-0255)
  - See HISTORY/changelog.gz for the other bug fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
 
47
47
-- make sure we don't choke on readonly values
48
48
do language plperl $$ elog(NOTICE, ${^TAINT}); $$;
 
49
 
 
50
-- test recovery after "die"
 
51
 
 
52
create or replace function just_die() returns void language plperl AS $$
 
53
die "just die";
 
54
$$;
 
55
 
 
56
select just_die();
 
57
 
 
58
create or replace function die_caller() returns int language plpgsql as $$
 
59
BEGIN
 
60
  BEGIN
 
61
    PERFORM just_die();
 
62
  EXCEPTION WHEN OTHERS THEN
 
63
    RAISE NOTICE 'caught die';
 
64
  END;
 
65
  RETURN 1;
 
66
END;
 
67
$$;
 
68
 
 
69
select die_caller();
 
70
 
 
71
create or replace function indirect_die_caller() returns int language plperl as $$
 
72
my $prepared = spi_prepare('SELECT die_caller() AS fx');
 
73
my $a = spi_exec_prepared($prepared)->{rows}->[0]->{fx};
 
74
my $b = spi_exec_prepared($prepared)->{rows}->[0]->{fx};
 
75
return $a + $b;
 
76
$$;
 
77
 
 
78
select indirect_die_caller();