5afe / eth-berlin-location-recovery

Recover your wallet simply and securely with 5 locations that you remember
https://gnosis.github.io/eth-berlin-location-recovery/
GNU Lesser General Public License v3.0
12 stars 6 forks source link

potential security issue #5

Open ligi opened 5 years ago

ligi commented 5 years ago

Really like the idea of the project!

But just wondering: aren't you leaking so much metadata to https://map-api-direct.foam.space and your tileprovider that your keyspace is very small and when you know this metadata your key can easily be brute forced?

tschubotz commented 5 years ago

Hey @ligi, Absolutely, potentially leaked metadata would make it easier for brute force attacks. That would have to be prevented for sure. Currently, the biggest issue is the keyspace anyway as FOAM only has ~10k POI on their platform. So even without additional knowledge via meta data, it is not secure enough :)

ademidun commented 1 year ago

Agreed with @ligi this is super cool!

I think you could solve the FOAM 10k limitation by using an aggregate of different geocoding apis and taking the average of the lat_long, then using the same geohashing algorighm you already use

I know the use of centralized providers may not be ideal, but decentralized, centralization could be thought of as the best of both worlds. I'm pretty sure the Chainlink Pricing Oracle works similarly [pricing_oracle].

berlin_lat_long_avg = avg(berlin_lat_long_1, berlin_lat_long_2, berlin_lat_long_3, berlin_lat_long_4)

berlin_lat_long_avg -> [geohash] -> privatekey_1_of_5

This allows the keyspace to be infinitely large as users can enter locations at any desired granularity

E.g. I could enter a location to be any choice of: Germany, Berlin, Kreuzberg, or Görli[gorli]

Caveats

I'm not sure how FOAM works. The website is confusing, but three's another problem that I think FOAM might solve but this one deosn't: if you allowed people to enter locations at any granularity from Country to Neighborhood level is how long should the geohash be?

Fortunately many geocoding APIs have a "type" field. Which tells us how specific the location is.

We can map each provider's type to a defined geohash length

geohash_length_average = avg(7,7,6) -> 6.67 -> round(6.67) -> 6

The more I think about this the more I realize that there are workarounds for all the different edge cases. However, the fundamental challenge is that it's not mathetmatically deterministic. However, it could potentially be "deterministic enough".

Appendix

[gorli] fun fact (Görli is the name of both the Ethereum testnet and a park and (former?) train station in Berlin

[pricing_oracle] Chainlink pricing oracles

Three-Levels-of-Aggregation-November-2022_V1-2048x1152 image