New issue
Advanced search Search tips

Issue 922213 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Jan 17
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug



Sign in to add a comment

Heap-buffer-overflow in pageInsertArray

Project Member Reported by ClusterFuzz, Jan 15

Issue description

Detailed report: https://clusterfuzz.com/testcase?key=5684221825515520

Fuzzer: afl_sqlite3_dbfuzz2_fuzzer
Fuzz target binary: sqlite3_dbfuzz2_fuzzer
Job Type: afl_chrome_asan
Platform Id: linux

Crash Type: Heap-buffer-overflow READ {*}
Crash Address: 0x61a00000b308
Crash State:
  pageInsertArray
  editPage
  balance_nonroot
  
Sanitizer: address (ASAN)

Recommended Security Severity: Medium

Regressed: https://clusterfuzz.com/revisions?job=afl_chrome_asan&range=614849:614856

Reproducer Testcase: https://clusterfuzz.com/download?testcase_id=5684221825515520

Issue filed automatically.

See https://github.com/google/clusterfuzz-tools for instructions to reproduce this bug locally.
 
Project Member

Comment 1 by ClusterFuzz, Jan 15

Components: Internals>Storage
Labels: Test-Predator-Auto-Components
Automatically applying components based on crash stacktrace and information from OWNERS files.

If this is incorrect, please apply the Test-Predator-Wrong-Components label.
Project Member

Comment 2 by ClusterFuzz, Jan 15

Cc: pwnall@chromium.org
Labels: ClusterFuzz-Auto-CC
Automatically adding ccs based on OWNERS file / target commit history.

If this is incorrect, please add ClusterFuzz-Wrong label.
Project Member

Comment 3 by ClusterFuzz, Jan 15

Labels: Test-Predator-Auto-Owner
Owner: mpdenton@chromium.org
Status: Assigned (was: Untriaged)
Automatically assigning owner based on suspected regression changelist https://chromium.googlesource.com/chromium/src/+/e3140a8f27345d395ea75fe619d730951a438e89 (Run SQLite DBFuzz2 on ClusterFuzz to fuzz for data corruption).

If this is incorrect, please let us know why and apply the Test-Predator-Wrong-CLs label. If you aren't the correct owner for this issue, please unassign yourself as soon as possible so it can be re-triaged.
Project Member

Comment 4 by sheriffbot@chromium.org, Jan 16 (6 days ago)

Labels: Target-73 M-73
Project Member

Comment 5 by sheriffbot@chromium.org, Jan 16 (6 days ago)

Labels: ReleaseBlock-Stable
This is a serious security regression. If you are not able to fix this quickly, please revert the change that introduced it.

If this doesn't affect a release branch, or has not been properly classified for severity, please update the Security_Impact or Security_Severity labels, and remove the ReleaseBlock label. To disable this altogether, apply ReleaseBlock-NA.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 6 by sheriffbot@chromium.org, Jan 16 (6 days ago)

Labels: Pri-1

Comment 7 by mpdenton@chromium.org, Jan 16 (6 days ago)

Cc: -pwnall@chromium.org drhsql...@gmail.com danielk1...@gmail.com
Labels: -Type-Bug-Security -Restrict-View-SecurityTeam -Security_Severity-Medium -Security_Impact-Head -ReleaseBlock-Stable -M-73 -Target-73 Type-Bug
Owner: pwnall@chromium.org
DBFuzz2 test-case is attached, Dr. Hipp can you let us know if you can reproduce this? Thanks!
clusterfuzz-testcase-minimized-sqlite3_dbfuzz2_fuzzer-5684221825515520
1.6 KB View Download

Comment 8 by drhsql...@gmail.com, Jan 16 (6 days ago)

This problem does not express on trunk.  I bisected to a possible fix at https://sqlite.org/src/info/10f9e39d6ed2413f

Comment 9 by pwnall@chromium.org, Jan 16 (6 days ago)

Status: Started (was: Assigned)
Thank you very much for the quick response, Richard! That check-in does fix the problem, and I am backporting it.
Project Member

Comment 10 by bugdroid1@chromium.org, Jan 17 (6 days ago)

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda

commit 77c3fd7aca79b3e1f71c600f69c30667b6cd2cda
Author: Victor Costan <pwnall@chromium.org>
Date: Thu Jan 17 02:55:38 2019

sqlite: Backport a third round of bugfixes.

Bug:  921894 ,  922213 ,  922312 
Change-Id: I2a72cef00d5429a9f7e15ee94e708e4166022df4
Reviewed-on: https://chromium-review.googlesource.com/c/1416399
Reviewed-by: Chris Mumford <cmumford@google.com>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#623540}
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/amalgamation/sqlite3.c
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0001-Modify-default-VFS-to-support-WebDatabase.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0002-Virtual-table-supporting-recovery-of-corrupted-datab.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0003-Custom-shell.c-helpers-to-load-Chromium-s-ICU-data.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0004-fts3-Disable-fts3_tokenizer-and-fts4.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0005-fuchsia-Use-dot-file-locking-for-sqlite.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0006-Fix-dbfuzz2-for-Clusterfuzz.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0007-Fix-the-Makefile-so-that-it-honors-CFLAGS-when-build.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0008-Adjustments-to-the-page-cache-to-try-to-avoid-harmle.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0009-Remove-an-ALWAYS-from-a-branch-that-is-not-always-ta.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0010-Fix-a-problem-with-nested-CTEs-with-the-same-table.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0011-Fix-detection-of-self-referencing-rows-in-foreign-ke.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0012-Fix-a-segfault-caused-by-using-the-RAISE-function-in.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0013-Fix-for-an-assert-that-could-be-false.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0014-Fix-another-problem-found-by-Matthew-Denton-s-new-fu.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0015-Report-a-new-corruption-case.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0016-Avoid-a-buffer-overread-in-ptrmapPutOvflPtr.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0017-Improved-detection-of-cell-corruption-in-sqlite3Vdbe.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0018-Fix-a-segfault-in-fts3-prompted-by-a-corrupted-datab.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0019-Prevent-integer-overflow-from-leading-to-buffer-over.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0020-Add-extra-tests-for-database-corruption-inside-defra.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0021-Fix-an-off-by-one-error-on-a-Goto-in-the-code-genera.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0022-Fix-overread-on-corrupted-btree-key.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0023-Avoid-buffer-overreads-on-corrupted-database-files.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0024-Fix-integer-overflow-while-running-PRAGMA-integrity_.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0025-Improved-corruption-handling-while-balancing-pages.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0026-Avoid-reading-off-the-front-of-a-page-buffer-when-ba.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0027-Fix-MSAN-error-in-sqlite3VdbeRecordUnpack-on-a-corru.patch
[add] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0028-Fix-deleting-a-B-tree-entry-in-a-corrupt-database.patch
[add] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0029-Fix-sorting-results-with-SRT_EphemTab-and-a-LIMIT-cl.patch
[add] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/patches/0030-Fix-detection-of-orphaned-and-malformed-autoindexes.patch
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/src/src/btree.c
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/src/src/prepare.c
[modify] https://crrev.com/77c3fd7aca79b3e1f71c600f69c30667b6cd2cda/third_party/sqlite/src/src/select.c

Project Member

Comment 11 by ClusterFuzz, Jan 17 (6 days ago)

ClusterFuzz has detected this issue as fixed in range 623510:623546.

Detailed report: https://clusterfuzz.com/testcase?key=5684221825515520

Fuzzer: afl_sqlite3_dbfuzz2_fuzzer
Fuzz target binary: sqlite3_dbfuzz2_fuzzer
Job Type: afl_chrome_asan
Platform Id: linux

Crash Type: Heap-buffer-overflow READ {*}
Crash Address: 0x61a00000b308
Crash State:
  pageInsertArray
  editPage
  balance_nonroot
  
Sanitizer: address (ASAN)

Recommended Security Severity: Medium

Regressed: https://clusterfuzz.com/revisions?job=afl_chrome_asan&range=614849:614856
Fixed: https://clusterfuzz.com/revisions?job=afl_chrome_asan&range=623510:623546

Reproducer Testcase: https://clusterfuzz.com/download?testcase_id=5684221825515520

See https://github.com/google/clusterfuzz-tools for instructions to reproduce this bug locally.

If you suspect that the result above is incorrect, try re-doing that job on the test case report page.
Project Member

Comment 12 by ClusterFuzz, Jan 17 (6 days ago)

Labels: ClusterFuzz-Verified
Status: Verified (was: Started)
ClusterFuzz testcase 5684221825515520 is verified as fixed, so closing issue as verified.

If this is incorrect, please add ClusterFuzz-Wrong label and re-open the issue.

Sign in to add a comment