Operating System:

[Juniper]

Published:

30 October 2020

Protect yourself against future threats.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

===========================================================================
             AUSCERT External Security Bulletin Redistribution

                              ESB-2020.3573.2
           2020-10 Security Bulletin: Junos OS: Multiple SQLite
                         vulnerabilities resolved.
                              30 October 2020

===========================================================================

        AusCERT Security Bulletin Summary
        ---------------------------------

Product:           Junos OS
Publisher:         Juniper Networks
Operating System:  Juniper
Impact/Access:     Execute Arbitrary Code/Commands -- Remote/Unauthenticated      
                   Denial of Service               -- Remote/Unauthenticated      
                   Cross-site Scripting            -- Remote with User Interaction
                   Access Confidential Data        -- Remote/Unauthenticated      
Resolution:        Patch/Upgrade
CVE Names:         CVE-2019-16168 CVE-2019-9937 CVE-2019-9936
                   CVE-2019-8457 CVE-2019-5018 CVE-2018-20506
                   CVE-2018-20505 CVE-2018-20346 CVE-2018-8740
                   CVE-2017-15286 CVE-2017-13685 CVE-2017-10989
                   CVE-2016-6153 CVE-2015-6607 CVE-2015-5895
                   CVE-2015-3717 CVE-2015-3416 CVE-2015-3415
                   CVE-2015-3414 CVE-2013-7443 CVE-2008-6593
                   CVE-2008-6592 CVE-2008-6590 CVE-2008-6589

Reference:         ESB-2020.2019
                   ESB-2020.1482
                   ESB-2019.2196

Original Bulletin: 
   https://kb.juniper.net/InfoCenter/index?page=content&id=JSA11055&actp=RSS

Revision History:  October 30 2020: vendor released minor update
                   October 16 2020: Initial Release

- --------------------------BEGIN INCLUDED TEXT--------------------

2020-10 Security Bulletin: Junos OS: Multiple SQLite vulnerabilities resolved.

Article ID  : JSA11055
Last Updated: 29 Oct 2020
Version     : 3.0

Product Affected:
This issue affects Junos OS 15.1X49, 17.2, 17.3, 17.4, 18.1, 18.2, 18.3, 18.4,
19.1, 19.2, 19.3, 19.4, 20.1.
Problem:

Multiple vulnerabilities have been resolved in Juniper Networks Junos OS by
updating third party software included with Junos OS devices.

In Junos OS, the majority of attack vectors in this announcement require
multiple chaining attack events to be successful against services which do not
directly call SQLite. For the attacker to be able to access and successfully
execute commands on the device, only one attack vector is known to exist.

These issues potentially allow an attacker to execute code or commands thereby
allowing full access to the device.

These issues affects Juniper Networks Junos OS:

  o 15.1X49 versions prior to 15.1X49-D220;
  o 17.2 versions prior to 17.2R3-S4;
  o 17.3 versions prior to 17.3R3-S8;
  o 17.4 versions prior to 17.4R2-S11, 17.4R3-S2;
  o 18.1 versions prior to 18.1R3-S10;
  o 18.2 versions prior to 18.2R2-S7, 18.2R3-S5;
  o 18.3 versions prior to 18.3R2-S4, 18.3R3-S2;
  o 18.4 versions prior to 18.4R1-S7, 18.4R2-S5, 18.4R3-S3;
  o 19.1 versions prior to 19.1R1-S5, 19.1R2-S2, 19.1R3-S2;
  o 19.2 versions prior to 19.2R1-S5, 19.2R2;
  o 19.3 versions prior to 19.3R2-S3, 19.3R3;
  o 19.4 versions prior to 19.4R1-S3, 19.4R2-S1, 19.4R3;
  o 20.1 versions prior to 20.1R1-S2, 20.1R2.

These issues are not applicable to releases prior to 15.1X49.

Juniper SIRT is not aware of any malicious exploitation of these
vulnerabilities.

Juniper SIRT is aware of publicly available SQLite exploits.

Important security issues resolved include:

     CVE           CVSS                           Summary
                             In SQLite through 3.29.0, whereLoopAddBtreeIndex
               4.3 AV:N/AC:M in sqlite3.c can crash a browser or other
CVE-2019-16168 /Au:N/C:N/I:N application because of missing validation of a
               /A:P          sqlite_stat1 sz field, aka a "severe division by
                             zero in the query planner."
               7.5 (         In SQLite 3.27.2, interleaving reads and writes in
               CVSS:3.0/AV:N a single transaction with an fts5 virtual table
CVE-2019-9937  /AC:L/PR:N/   will lead to a NULL Pointer Dereference in
               UI:N/S:U/C:N/ fts5ChunkIterate in sqlite3.c. This is related to
               I:N/A:H )     ext/fts5/fts5_hash.c and ext/fts5/fts5_index.c.
               7.5 (         In SQLite 3.27.2, running fts5 prefix queries
               CVSS:3.0/AV:N inside a transaction could trigger a heap-based
CVE-2019-9936  /AC:L/PR:N/   buffer over-read in fts5HashEntrySort in
               UI:N/S:U/C:H/ sqlite3.c, which may lead to an information leak.
               I:N/A:N )     This is related to ext/fts5/fts5_hash.c.
               7.5 AV:N/AC:L SQLite3 from 3.6.0 to and including 3.27.2 is
CVE-2019-8457  /Au:N/C:P/I:P vulnerable to heap out-of-bound read in the
               /A:P          rtreenode() function when handling invalid rtree
                             tables.
                             An exploitable use after free vulnerability exists
               8.1 (         in the window function functionality of Sqlite3
               CVSS:3.0/AV:N 3.26.0. A specially crafted SQL command can cause
CVE-2019-5018  /AC:H/PR:N/   a use after free vulnerability, potentially
               UI:N/S:U/C:H/ resulting in remote code execution. An attacker
               I:H/A:H )     can send a malicious SQL command to trigger this
                             vulnerability.
                             SQLite before 3.25.3, when the FTS3 extension is
                             enabled, encounters an integer overflow (and
               8.1 (         resultant buffer overflow) for FTS3 queries in a
               CVSS:3.0/AV:N "merge" operation that occurs after crafted
CVE-2018-20506 /AC:H/PR:N/   changes to FTS3 shadow tables, allowing remote
               UI:N/S:U/C:H/ attackers to execute arbitrary code by leveraging
               I:H/A:H )     the ability to run arbitrary SQL statements (such
                             as in certain WebSQL use cases). This is a
                             different vulnerability than CVE-2018-20346.
               7.5 (         SQLite 3.25.2, when queries are run on a table
               CVSS:3.0/AV:N with a malformed PRIMARY KEY, allows remote
CVE-2018-20505 /AC:L/PR:N/   attackers to cause a denial of service
               UI:N/S:U/C:N/ (application crash) by leveraging the ability to
               I:N/A:H )     run arbitrary SQL statements (such as in certain
                             WebSQL use cases).
                             SQLite before 3.25.3, when the FTS3 extension is
               8.1 (         enabled, encounters an integer overflow (and
               CVSS:3.0/AV:N resultant buffer overflow) for FTS3 queries that
CVE-2018-20346 /AC:H/PR:N/   occur after crafted changes to FTS3 shadow tables,
               UI:N/S:U/C:H/ allowing remote attackers to execute arbitrary
               I:H/A:H )     code by leveraging the ability to run arbitrary
                             SQL statements (such as in certain WebSQL use
                             cases), aka Magellan.
               7.5 (         In SQLite through 3.22.0, databases whose schema
               CVSS:3.0/AV:N is corrupted using a CREATE TABLE AS statement
CVE-2018-8740  /AC:L/PR:N/   could cause a NULL pointer dereference, related to
               UI:N/S:U/C:N/ build.c and prepare.c.
               I:N/A:H )
               7.5 (         SQLite 3.20.1 has a NULL pointer dereference in
               CVSS:3.0/AV:N tableColumnList in shell.c because it fails to
CVE-2017-15286 /AC:L/PR:N/   consider certain cases where `sqlite3_step(pStmt)=
               UI:N/S:U/C:N/ =SQLITE_ROW` is false and a data structure is
               I:N/A:H )     never initialized.
               5.5 (         The dump_callback function in SQLite 3.20.0 allows
               CVSS:3.0/AV:L remote attackers to cause a denial of service
CVE-2017-13685 /AC:L/PR:N/   (EXC_BAD_ACCESS and application crash) via a
               UI:R/S:U/C:N/ crafted file.
               I:N/A:H )
               9.8 (         The getNodeSize function in ext/rtree/rtree.c in
               CVSS:3.0/AV:N SQLite through 3.19.3, as used in GDAL and other
CVE-2017-10989 /AC:L/PR:N/   products, mishandles undersized RTree blobs in a
               UI:N/S:U/C:H/ crafted database, leading to a heap-based buffer
               I:H/A:H )     over-read or possibly unspecified other impact.
                             os_unix.c in SQLite before 3.13.0 improperly
               5.9 (         implements the temporary directory search
               CVSS:3.0/AV:L algorithm, which might allow local users to obtain
CVE-2016-6153  /AC:L/PR:N/   sensitive information, cause a denial of service
               UI:N/S:U/C:L/ (application crash), or have unspecified other
               I:L/A:L )     impact by leveraging use of the current working
                             directory for temporary files.
               6.8 (AV:N/    SQLite before 3.8.9, as used in Android before
CVE-2015-6607  AC:M/Au:N/C:P 5.1.1 LMY48T, allows attackers to gain privileges
               /I:P/A:P)     via a crafted application, aka internal bug
                             20099586.
               10.0 (AV:N/   Multiple unspecified vulnerabilities in SQLite
CVE-2015-5895  AC:L/Au:N/C:C before 3.8.10.2, as used in Apple iOS before 9,
               /I:C/A:C)     have unknown impact and attack vectors.
                             Multiple buffer overflows in the printf
               7.5 (AV:N/    functionality in SQLite, as used in Apple iOS
CVE-2015-3717  AC:L/Au:N/C:P before 8.4 and OS X before 10.10.4, allow remote
               /I:P/A:P)     attackers to execute arbitrary code or cause a
                             denial of service (application crash) via
                             unspecified vectors.
                             The sqlite3VXPrintf function in printf.c in SQLite
                             before 3.8.9 does not properly handle precision
                             and width values during floating-point
               7.5 (AV:N/    conversions, which allows context-dependent
CVE-2015-3416  AC:L/Au:N/C:P attackers to cause a denial of service (integer
               /I:P/A:P)     overflow and stack-based buffer overflow) or
                             possibly have unspecified other impact via large
                             integers in a crafted printf function call in a
                             SELECT statement.
                             The sqlite3VdbeExec function in vdbe.c in SQLite
                             before 3.8.9 does not properly implement
               7.5 (AV:N/    comparison operators, which allows
CVE-2015-3415  AC:L/Au:N/C:P context-dependent attackers to cause a denial of
               /I:P/A:P)     service (invalid free operation) or possibly have
                             unspecified other impact via a crafted CHECK
                             clause, as demonstrated by CHECK(0&O>O) in a
                             CREATE TABLE statement.
                             SQLite before 3.8.9 does not properly implement
                             the dequoting of collation-sequence names, which
               7.5 (AV:N/    allows context-dependent attackers to cause a
CVE-2015-3414  AC:L/Au:N/C:P denial of service (uninitialized memory access and
               /I:P/A:P)     application crash) or possibly have unspecified
                             other impact via a crafted COLLATE clause, as
                             demonstrated by COLLATE"""""""" at the end of a
                             SELECT statement.
               5.0 (AV:N/    Buffer overflow in the skip-scan optimization in
CVE-2013-7443  AC:L/Au:N/C:N SQLite 3.8.2 allows remote attackers to cause a
               /I:N/A:P)     denial of service (crash) via crafted SQL
                             statements.
                             SQL injection vulnerability in LightNEasy/
               7.5 (AV:N/    lightneasy.php in LightNEasy SQLite 1.2.2 and
CVE-2008-6593  AC:L/Au:N/C:P earlier allows remote attackers to inject
               /I:P/A:P)     arbitrary PHP code into comments.dat via the dlid
                             parameter to index.php.
                             thumbsup.php in Thumbs-Up 1.12, as used in
                             LightNEasy "no database" (aka flat) and SQLite
               7.5 (AV:N/    1.2.2 and earlier, allows remote attackers to
CVE-2008-6592  AC:L/Au:N/C:P copy, rename, and read arbitrary files via
               /I:P/A:P)     directory traversal sequences in the image
                             parameter with a modified cache_dir parameter
                             containing a %00 (encoded null byte).
                             Multiple directory traversal vulnerabilities in
               5.0 (AV:N/    LightNEasy "no database" (aka flat) version 1.2.2,
CVE-2008-6590  AC:L/Au:N/C:P and possibly SQLite version 1.2.2, allow remote
               /I:N/A:N)     attackers to read arbitrary files via a .. (dot
                             dot) in the page parameter to (1) index.php and
                             (2) LightNEasy.php.
                             Multiple cross-site scripting (XSS)
               4.3 (AV:N/    vulnerabilities in LightNEasy "no database" (aka
CVE-2008-6589  AC:M/Au:N/C:N flat) version 1.2.2, and possibly SQLite version
               /I:P/A:N)     1.2.2, allow remote attackers to inject arbitrary
                             web script or HTML via the page parameter to (1)
                             index.php and (2) LightNEasy.php.

Solution:

The following software releases have been updated to resolve this specific
issue: 15.1X49-D220, 17.2R3-S4, 17.3R3-S8, 17.4R2-S11, 17.4R3-S2, 18.1R3-S10,
18.2R2-S7, 18.2R3-S5, 18.3R2-S4, 18.3R3-S2, 18.4R1-S7, 18.4R2-S5, 18.4R3-S3,
19.1R1-S5, 19.1R2-S2, 19.1R3-S2, 19.2R1-S5, 19.2R2, 19.3R2-S3, 19.3R3,
19.4R1-S3, 19.4R2-S1, 19.4R3, 20.1R1-S2, 20.1R2, 20.2R1, and all subsequent
releases.

This issue is being tracked as 1480208 .

Workaround:

To reduce the risk of exploitation:

* Discontinue the use of SLAX scripts and the REST API.

* Monitor /var/chroot/rest-api/var/log for malicious activity.

* Allow access to the device from only trusted networks, administrators and
hosts and utilize jumpboxes.

Implementation:
Software releases or updates are available for download at https://
www.juniper.net/support/downloads/ .
Modification History:
2020-10-14: Initial Publication.
CVSS Score:
7.8 (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)
Severity Level:
High
Severity Assessment:
Information for how Juniper Networks uses CVSS can be found at KB 16446 "Common
Vulnerability Scoring System (CVSS) and Juniper's Security Advisories."

- --------------------------END INCLUDED TEXT--------------------

You have received this e-mail bulletin as a result of your organisation's
registration with AusCERT. The mailing list you are subscribed to is
maintained within your organisation, so if you do not wish to continue
receiving these bulletins you should contact your local IT manager. If
you do not know who that is, please send an email to auscert@auscert.org.au
and we will forward your request to the appropriate person.

NOTE: Third Party Rights
This security bulletin is provided as a service to AusCERT's members.  As
AusCERT did not write the document quoted above, AusCERT has had no control
over its content. The decision to follow or act on information or advice
contained in this security bulletin is the responsibility of each user or
organisation, and should be considered in accordance with your organisation's
site policies and procedures. AusCERT takes no responsibility for consequences
which may arise from following or acting on information or advice contained in
this security bulletin.

NOTE: This is only the original release of the security bulletin.  It may
not be updated when updates to the original are made.  If downloading at
a later date, it is recommended that the bulletin is retrieved directly
from the author's website to ensure that the information is still current.

Contact information for the authors of the original document is included
in the Security Bulletin above.  If you have any questions or need further
information, please contact them directly.

Previous advisories and external security bulletins can be retrieved from:

        https://www.auscert.org.au/bulletins/

===========================================================================
Australian Computer Emergency Response Team
The University of Queensland
Brisbane
Qld 4072

Internet Email: auscert@auscert.org.au
Facsimile:      (07) 3365 7031
Telephone:      (07) 3365 4417 (International: +61 7 3365 4417)
                AusCERT personnel answer during Queensland business hours
                which are GMT+10:00 (AEST).
                On call after hours for member emergencies only.
===========================================================================
-----BEGIN PGP SIGNATURE-----
Comment: http://www.auscert.org.au/render.html?it=1967

iQIVAwUBX5tiK+NLKJtyKPYoAQiwVQ/+MiszMN22jYbEwY4+gl+vr2iYLnP787fD
3efpsjD/+8i537ncr1rveFCtRDU6hMEcEP418HS/0ujI3m65AgBuG9o+qQl+cl/X
rj3FHkKX+54nQseMMfqfPS7/LPlVUKOYflnpNoEw4Axw8/MDcxS8b9/jrejw5pf4
sF427D8gTacJNg2vI7MDLrnGnG5nu7iUCvLPENTn9yg8im+CisLgO8yGt0KCukWR
A2JZtgLtZPbmc0Wak8F+4DrsGgvbpBFBEOIZ5Aj0y3dlgrS5laODcgE9c3lZ+MFU
wo8ve77JWNJFaevEVUX6YAWgtJoiJLZobvIJRTgbuuzQVkkvHFaGwnm06r7jGZNt
GNb+tTJuFG0Ev+xgxT4ZkD0qvAJ4J88CzsVuMPRoBKdEm9n3x4iijCyV06ktZPbu
CuewvIGg92gJxK8KCLMZy7yIwqDnNQkNmFU+rrmgGOEP1DRLse5XUGZEl8tgmsxx
O6NPr8Fr8xvyQJSvH5XcDIb2ViybMrhaVS2cafDRK5IDcw7dj7cp9NpWX4sYksHA
vd+yIRpMCrqUzE0IRFNKDVL5dK02wkVFmOo40YYnb6W6GPwTSVlb0+OO4ZD/LFND
Wsm9A3ORAXPUnHj98cPSh6TSFRkscWQXqReCvCvf0Ik0ZdRDCha+dQDaZFDyHgy6
aSIGeWKRcoQ=
=B1P9
-----END PGP SIGNATURE-----