bugPSPP - Bugs: bug #54686, heap-buffer-overflow in csv driver...

 
 

bug #54686: heap-buffer-overflow in csv driver of pspp-convert

Submitter:  Tianxiao Gu <tianxiaogu>
Submitted:  Wed 19 Sep 2018 04:19:28 AM UTC
   
 
Category:  Output Driver Severity:  5 - Average
Status:  Fixed Assigned to:  None
Open/Closed:  Closed Release:  None
Effort:  0.00
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 17 Nov 2018 02:15:55 PM UTC, comment #3: 


> Has this bug been fixed or is it still open?


This is fixed with the update to recent gnulib. Thanks for the reminder. Closing.

Ben Pfaff <blp>
Group administrator
Sat 17 Nov 2018 08:05:26 AM UTC, comment #2: 

Has this bug been fixed or is it still open?

John Darrington <jmd>
Group administrator
Sun 23 Sep 2018 05:35:35 AM UTC, comment #1: 

Thank you for the bug report.

I agree that this seems to be a gnulib bug.  I reported it to the gnulib mailing list.  I imagine that my bug report will appear in the archive under Sept. 22 or 23 soon here: http://lists.gnu.org/archive/html/bug-gnulib/2018-09/index.html

Ben Pfaff <blp>
Group administrator
Wed 19 Sep 2018 04:19:28 AM UTC, original submission:  

Affected version: both git head and pspp-v1.0.1

Note that it seems to be a bug in gnulib.

Build:
~~~
export CFLAGS="-fsanitize=address -g -O0"
make -Smake # optional for git
./configure
make
~~~

Reproduce:
~~~
pspp-convert pspp-convert-000002 -O csv /dev/null
~~~

Output:
~~~
`pspp-convert-000002' near offset 0x654: Long variable mapping from GROUP to invalid variable name `gr|up'.
=================================================================
==18286==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x612000000d4e at pc 0x7f93e0f3bdd5 bp 0x7ffe1d6d0a20 sp 0x7ffe1d6d0a10
WRITE of size 1 at 0x612000000d4e thread T0
    #0 0x7f93e0f3bdd4 in convert_to_decimal /home/t/Projects/fuzzing/pspp-1.0.1/gl/vasnprintf.c:899
    #1 0x7f93e0f3d8a4 in scale10_round_decimal_decoded /home/t/Projects/fuzzing/pspp-1.0.1/gl/vasnprintf.c:1292
    #2 0x7f93e0f3dc86 in scale10_round_decimal_double /home/t/Projects/fuzzing/pspp-1.0.1/gl/vasnprintf.c:1328
    #3 0x7f93e0f45630 in vasnprintf /home/t/Projects/fuzzing/pspp-1.0.1/gl/vasnprintf.c:4119
    #4 0x7f93e0f3888e in rpl_snprintf /home/t/Projects/fuzzing/pspp-1.0.1/gl/snprintf.c:45
    #5 0x7f93e0de674f in csv_write_var__ src/data/csv-file-writer.c:360
    #6 0x7f93e0de6ae5 in csv_write_var src/data/csv-file-writer.c:391
    #7 0x7f93e0de6c78 in csv_write_case src/data/csv-file-writer.c:405
    #8 0x7f93e0de6d73 in csv_file_casewriter_write src/data/csv-file-writer.c:424
    #9 0x7f93e0de30f1 in casewriter_write src/data/casewriter.c:57
    #10 0x55f1c78cd032 in main utilities/pspp-convert.c:217
    #11 0x7f93e0987b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #12 0x55f1c78cc579 in _start (/home/t/Projects/fuzzing/pspp-1.0.1/utilities/.libs/pspp-convert+0x2579)

0x612000000d4e is located 0 bytes to the right of 270-byte region [0x612000000c40,0x612000000d4e)
allocated by thread T0 here:
    #0 0x7f93e1321b50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x7f93e0f3baba in convert_to_decimal /home/t/Projects/fuzzing/pspp-1.0.1/gl/vasnprintf.c:863
    #2 0x7f93e0f3d8a4 in scale10_round_decimal_decoded /home/t/Projects/fuzzing/pspp-1.0.1/gl/vasnprintf.c:1292
    #3 0x7f93e0f3dc86 in scale10_round_decimal_double /home/t/Projects/fuzzing/pspp-1.0.1/gl/vasnprintf.c:1328
    #4 0x7f93e0f45630 in vasnprintf /home/t/Projects/fuzzing/pspp-1.0.1/gl/vasnprintf.c:4119
    #5 0x7f93e0f3888e in rpl_snprintf /home/t/Projects/fuzzing/pspp-1.0.1/gl/snprintf.c:45
    #6 0x7f93e0de674f in csv_write_var__ src/data/csv-file-writer.c:360
    #7 0x7f93e0de6ae5 in csv_write_var src/data/csv-file-writer.c:391
    #8 0x7f93e0de6c78 in csv_write_case src/data/csv-file-writer.c:405
    #9 0x7f93e0de6d73 in csv_file_casewriter_write src/data/csv-file-writer.c:424
    #10 0x7f93e0de30f1 in casewriter_write src/data/casewriter.c:57
    #11 0x55f1c78cd032 in main utilities/pspp-convert.c:217
    #12 0x7f93e0987b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/t/Projects/fuzzing/pspp-1.0.1/gl/vasnprintf.c:899 in convert_to_decimal
Shadow bytes around the buggy address:
  0x0c247fff8150: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x0c247fff8160: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c247fff8170: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa
  0x0c247fff8180: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
  0x0c247fff8190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c247fff81a0: 00 00 00 00 00 00 00 00 00[06]fa fa fa fa fa fa
  0x0c247fff81b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c247fff81c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c247fff81d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c247fff81e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c247fff81f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==18286==ABORTING
~~~

Tianxiao Gu <tianxiaogu>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #45045:  pspp-convert-000002 added by tianxiaogu (3KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jmd (Posted a comment)
  • -email is unavailable- added by blp (Posted a comment)
  • -email is unavailable- added by tianxiaogu (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-11-17 blp Open/ClosedOpen Closed
    2018-11-17 blp StatusConfirmed Fixed
    2018-09-23 blp StatusNone Confirmed
    2018-09-19 tianxiaogu Attached File- Added pspp-convert-000002, #45045

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code