bugPSPP - Bugs: bug #61258, use-after-free in pspp at...

 
 

bug #61258: use-after-free in pspp at i18n.c:499

Submitter:  Irfan Ariq <irfanariq>
Submitted:  Thu 30 Sep 2021 08:24:00 PM UTC
   
 
Category:  Other Severity:  5 - Average
Status:  Fixed Assigned to:  None
Open/Closed:  Closed Release:  None
Effort:  0.00
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 05 Oct 2021 04:21:08 PM UTC, comment #1: 

Thanks for reporting this bug. I reproduced this with the current main branch and fixed it with commit 7ae167da42b6 ("dictionary: Allow dict_set_documents() argument to reference old documents.").

Ben Pfaff <blp>
Group administrator
Thu 30 Sep 2021 08:24:00 PM UTC, original submission:  

Hello,

We are currently working on fuzz testing feature, and we found a *use-after-free* on `pspp`.

The stack traces are as follow:
```st
==29418==ERROR: AddressSanitizer: heap-use-after-free on address 0x6030000062b0 at pc 0x7ff09c01c66e bp 0x7ffe378290b0 sp 0x7ffe37828858
READ of size 2 at 0x6030000062b0 thread T0
    #0 0x7ff09c01c66d  (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x5166d)
    #1 0x7ff09b945efc in utf8_encoding_concat_len src/libpspp/i18n.c:499
    #2 0x7ff09b946032 in utf8_encoding_trunc_len src/libpspp/i18n.c:530
    #3 0x7ff09b8cf228 in dict_add_document_line src/data/dictionary.c:1518
    #4 0x7ff09b8cf062 in dict_set_documents src/data/dictionary.c:1475
    #5 0x7ff09bcec536 in merge_dictionary src/language/data-io/combine-files.c:540
    #6 0x7ff09bceab32 in combine_files src/language/data-io/combine-files.c:268
    #7 0x7ff09bce9f33 in cmd_match_files src/language/data-io/combine-files.c:134
    #8 0x7ff09bbf2d63 in do_parse_command src/language/command.c:233
    #9 0x7ff09bbf2809 in cmd_parse_in_state src/language/command.c:147
    #10 0x7ff09bbf28d9 in cmd_parse src/language/command.c:162
    #11 0x5564ac75be30 in main src/ui/terminal/main.c:136
```
The full stack trace is attached.

*Step to reproduce*

We configured `pspp` using `CFLAGS="-g -O0 -fsanitize=address" CXXFLAGS="-g -O0 -fsanitize=address" ./configure --prefix=$(pwd)/ --without-cairo --without-perl-module` and built in using `make -j10`, and run it with:

```
./pspp -o /dev/null -O format=odt <attached file>
```
The input file is attached.

*Environment*
- OS: Ubuntu 18.04.5 LTS
- GCC version: gcc 7.5.0
- pspp version: [pspp 1.4.1](http://mirror.yongbok.net/gnu/pspp/pspp-1.4.1.tar.gz)

Thank you.

Irfan Ariq <irfanariq>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #52006:  full_stacktrace_poc_7.zip added by irfanariq (1KiB - application/x-zip-compressed)
file #52007:  input_pspp_poc_7.zip added by irfanariq (791B - application/x-zip-compressed)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by blp (Posted a comment)
  • -email is unavailable- added by irfanariq (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-10-05 blp CategoryNone Other
        StatusNone Fixed
        Open/ClosedOpen Closed
    2021-09-30 irfanariq Attached File- Added full_stacktrace_poc_7.zip, #52006
        Attached File- Added input_pspp_poc_7.zip, #52007

    Back to the top

    Powered by Savane 3.13-bb6a.
    Corresponding source code