m4b / m4b/goblin

Wrong dynamic library soname parsing

Open
#290 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.5k
Forks
202
PR merge metrics
No merged PRs in 30d

Description

Hello everyone,

I wanted to get the soname of a shared library and readelf was able to correctly determine the name,
but goblin wasn't able to do so. It just showed that the library had no soname. So I dug a bit in the elf
file specification and was able to get the correct value. With goblin I could simply call
elf.dynstrtab.get_at(elf.dynamic.unwrap().info.soname) and get the correct result. While implementing
lazy parsing, I encountered that goblin refuses to set a soname if dyninfo.soname is zero. So checking for
0 isn't correct here:
https://github.com/m4b/goblin/blob/b43b93ed2243b75043d6fb1021ad9aec227df1f5/src/elf/mod.rs#L297

I'm not sure how to correctly check if there isn't any soname.

Have a nice day everyone and thanks for the great library!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/elf/mod.rs around the soname handling referenced in the issue, then compare its zero-value check with the ELF specification and readelf's result. Verify that a valid soname is returned through the dynamic string table while a genuinely absent soname remains absent.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
reverse-engineering
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.