exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

overtheledger.txt

overtheledger.txt
Posted Mar 20, 2007
Authored by Chris Travers

LedgerSMB versions below 1.1.10 and SQL-Ledger versions below 2.6.27 suffer from arbitrary code execution flaws. SQL-Ledger also suffers from an authentication bypass vulnerability. Details provided.

tags | exploit, arbitrary, code execution, bypass
SHA-256 | b02d142d543c4e1b63e89850d09320c110d56c8a7b6b58ce6ea7b5cc79a90ff8

overtheledger.txt

Change Mirror Download
Hi;

Affected versions:
LedgerSMB < 1.1.10 (but see below), current is 1.1.11
SQL-Ledger < 2.6.27 (but see below). Current is 2.6.27

Effects: Arbitrary code execution (both products) and authentication
bypass (SQL-Ledger only).

We have discovered yet another major security issue in both SQL-Ledger
(for affected versions, see below) and LedgerSMB (<1.1.10, but see
below). The problem exists because the login input variable is not
properly checked, and the software runs a perl script derived from the
login name. If the script completes and a password is set, the password
is checked. In LedgerSMB, an additional check is made against a session
table, which will cause the script to go no further, but in SQL-Ledger,
this can also result in authentication bypass.

Affected Versions:
Unfortunately, both projects suffered problems with their security
fixes. The LedgerSMB team failed to update their version strings
properly so 1.1.10 will still display 1.1.9 as its running version.

To differentiate, you can use md5sum on the LedgerSMB/Form.pl
c9621e0ed0fd633663e1be3c6d5b08c4 ledger-smb-1.1.10/LedgerSMB/Form.pm
c311f02eaeee9e0638cbe08a650ab86d ledger-smb-1.1.9/LedgerSMB/Form.pm

The SQL-Ledger case is probably worse. The initial release of 2.6.27
included an inadequate and broken fix. A new security fix was issued
later that day, but it is unclear when all mirrors were updated, and
users who downloaded that version cannot be sure that they got one that
was not vulnerable. The initial security fix offers little safety:
authentication bypass and arbitrary code execution are still largely
possible though perhaps not at the same time (as they were before).

The following md5sum's reflect whether 2.6.17 was patched or not:
e97dc79c171a45bb794e253f94caef49 is unpatched
2a2dc05d5ac7085bd9e6aaa7098e1bf1 is patched.

How the exploit works:

SQL-Ledger and their derivatives (including LedgerSMB < forthcoming
1.2.0), store login state information in a machine-writable perl script
in a configurable location (by default users/). This file is read on
each page load and is named [username].conf. This file contains a hash
definition which is then used to validate the user's authentication
token. No provisions are taken to prevent directory transversal prior
to these fixes, however.

One can form a URL like:
http://localhost/sql-ledger/am.pl?login=../../../home/user/foo.pl%00&action=add_department

This causes the web server to execute ../../home/user/foo.pl (the %00
gets translated into a terminating NULL) and will then either allow
access (in SQL-Ledger < 2.6.27) or provide an error. In the faulty
versions of 2.6.27 and vulnerable versions of LedgerSMB, it will still
execute the script however.

The faulty version of SQL-Ledger have a major oversight, however, that
lends well to testing. Because the only check is on the NUL and not on
the signs of directory transversal, you can test the authentication
bypass and get access to sensitive configuration (including obfuscated
but unencrypted database passwords and application password hashes). A
sample URL for this is:
http://localhost/sql-ledger/am.pl?login=../sql-ledger&path=bin/mozilla&action=edit_template&file=users/members

This works because there is usually a Perl script named sql-ledger.conf
in the directory above where these scripts are normally stored. So the
username forces the execution of that script, doesn't find a password,
and so allows the user in. Lovely....

Best Wishes,
Chris Travers
Login or Register to add favorites

File Archive:

July 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    27 Files
  • 2
    Jul 2nd
    10 Files
  • 3
    Jul 3rd
    35 Files
  • 4
    Jul 4th
    27 Files
  • 5
    Jul 5th
    18 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    0 Files
  • 12
    Jul 12th
    0 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    0 Files
  • 16
    Jul 16th
    0 Files
  • 17
    Jul 17th
    0 Files
  • 18
    Jul 18th
    0 Files
  • 19
    Jul 19th
    0 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    0 Files
  • 23
    Jul 23rd
    0 Files
  • 24
    Jul 24th
    0 Files
  • 25
    Jul 25th
    0 Files
  • 26
    Jul 26th
    0 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close