apache / apache/iceberg-python

Implementation classes named in table properties are imported and instantiated without a type check

Aperta
#3,932 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Python
Stelle
1.1k
Fork
581
Merge medio
1g 17h
PR unite (30g)
78

Descrizione

Three properties name a class that PyIceberg imports and calls:

| Property | Resolved by | Called as |
|---|---|---|
| `py-io-impl` | `_import_file_io` (`pyiceberg/io/__init__.py`) | `class_(properties)` |
| `write.py-location-provider.impl` | `_import_location_provider` (`pyiceberg/table/locations.py`) | `class_(table_location, table_properties)` |
| `s3.retry-strategy-impl` | `_import_retry_strategy` (`pyiceberg/io/pyarrow.py`) | `class_()` |

Each follows the same pattern:

```python
module = importlib.import_module(module_name)
class_ = getattr(module, class_name)
return class_(...)
```

None of the three checks that the resolved object is the type it is about to be used as — there is no `issubclass` against `FileIO`, `LocationProvider`, or `S3RetryStrategy`. Any importable dotted name resolves and is called, with the property map passed as an argument in two of the three cases.

All three properties are read from the merged table property map, so their values can originate in a table's metadata rather than in the operator's catalog configuration.

---
Issue investigation generated via claude, reviewed by Sung, Kevin, Fokko.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start with _import_file_io in pyiceberg/io/__init__.py, _import_location_provider in pyiceberg/table/locations.py, and _import_retry_strategy in pyiceberg/io/pyarrow.py. Trace how each property is resolved and invoked, then verify that only subclasses of FileIO, LocationProvider, or S3RetryStrategy are accepted before instantiation; done means all three paths reject unrelated importable classes.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
security
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
68/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.