Skip to content

Commit

Permalink
Update lmdb initialization vuln.md
Browse files Browse the repository at this point in the history
update these pages to include the source code that you wrote
to produce the output shown in each "Debug" section
  • Loading branch information
YourButterfly committed Sep 24, 2019
1 parent 8e979b3 commit b44b0f8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lmdb/lmdb initialization vuln/lmdb initialization vuln.md
Expand Up @@ -12,6 +12,24 @@ version <=0.97

https://github.com/jnwatson/py-lmdb

## Reproduce

replace data.mdb with poc,
run the python script,

```python
import lmdb
env = lmdb.open("./train", map_size=1099511627776)
txn = env.begin(write=True)
txn.put(key = '1', value = 'aaa')
txn.put(key = '2', value = 'bbb')
txn.put(key = '3', value = 'ccc')
txn.delete(key = '1')
txn.put(key = '3', value = 'ddd')
txn.commit()
env.close()
```

## Vuln Detail

In function `mdb_cursor_put`,the value of `md_flags` determines the value of `mp_flags`.
Expand Down

0 comments on commit b44b0f8

Please sign in to comment.