forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit17351fc
committed
Prevent access to external files/URLs via XML entity references.
xml_parse() would attempt to fetch external files or URLs as needed toresolve DTD and entity references in an XML value, thus allowingunprivileged database users to attempt to fetch data with the privilegesof the database server. While the external data wouldn't get returneddirectly to the user, portions of it could be exposed in error messagesif the data didn't parse as valid XML; and in any case the mere abilityto check existence of a file might be useful to an attacker.The ideal solution to this would still allow fetching of references thatare listed in the host system's XML catalogs, so that documents can bevalidated according to installed DTDs. However, doing that with theavailable libxml2 APIs appears complex and error-prone, so we're not goingto risk it in a security patch that necessarily hasn't gotten wide review.So this patch merely shuts off all access, causing any external fetch tosilently expand to an empty string. A future patch may improve this.In HEAD and 9.2, also suppress warnings about undefined entities, whichwould otherwise occur as a result of not loading referenced DTDs. Previousbranches don't show such warnings anyway, due to different error handlingarrangements.Credit to Noah Misch for first reporting the problem, and for much worktowards a solution, though this simplistic approach was not his preference.Also thanks to Daniel Veillard for consultation.Security:CVE-2012-34891 parent03bda45 commit17351fc
4 files changed
+81
-2
lines changedLines changed: 41 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
48 | 48 |
| |
49 | 49 |
| |
50 | 50 |
| |
| 51 | + | |
51 | 52 |
| |
52 | 53 |
| |
53 | 54 |
| |
| |||
99 | 100 |
| |
100 | 101 |
| |
101 | 102 |
| |
| 103 | + | |
| 104 | + | |
102 | 105 |
| |
103 | 106 |
| |
| 107 | + | |
| 108 | + | |
104 | 109 |
| |
105 | 110 |
| |
106 | 111 |
| |
| |||
985 | 990 |
| |
986 | 991 |
| |
987 | 992 |
| |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
988 | 1000 |
| |
989 | 1001 |
| |
990 | 1002 |
| |
| |||
1027 | 1039 |
| |
1028 | 1040 |
| |
1029 | 1041 |
| |
1030 |
| - | |
| 1042 | + | |
1031 | 1043 |
| |
| 1044 | + | |
1032 | 1045 |
| |
1033 | 1046 |
| |
1034 | 1047 |
| |
| |||
1472 | 1485 |
| |
1473 | 1486 |
| |
1474 | 1487 |
| |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
1475 | 1507 |
| |
1476 | 1508 |
| |
1477 | 1509 |
| |
| |||
1566 | 1598 |
| |
1567 | 1599 |
| |
1568 | 1600 |
| |
1569 |
| - | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
1570 | 1609 |
| |
1571 | 1610 |
| |
1572 | 1611 |
| |
|
Lines changed: 20 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
896 | 896 |
| |
897 | 897 |
| |
898 | 898 |
| |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + |
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
789 | 789 |
| |
790 | 790 |
| |
791 | 791 |
| |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + |
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
259 | 259 |
| |
260 | 260 |
| |
261 | 261 |
| |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + |
0 commit comments
Comments
(0)