@@ -102,6 +102,7 @@ def get_data(self) -> bytes:
102102 @classmethod
103103 def from_data (cls , blob ):
104104 """Restore an object instance from a compressed datablob.
105+ `blob` **MUST NOT** be from an untrusted source.
105106
106107 Returns an instance of a concrete subclass."""
107108 version , data = decompress_datablob (DATA_BLOB_MAGIC_RETRY , blob )
@@ -334,6 +335,7 @@ def deconstruct(self, including_private: bool=False) -> bytes:
334335
335336 def set_data (self , blob : bytes ):
336337 """Restore a datablob created with deconstruct().
338+ `blob` **MUST NOT** be from an untrusted source.
337339
338340 You should only call this method once, and only immediately after constructing
339341 the object and before calling any other method or functionality (e.g. __enter__()).
@@ -1080,14 +1082,22 @@ def pause_dialog(self):
10801082 client.send_tan(...)
10811083
10821084 # Exiting the context here ends the dialog, unless frozen with pause_dialog() again.
1085+
1086+ **Warning:** `dialog_data` **MUST NOT** be stored in a place where an untrusted user could
1087+ modify it or you will have a major security issue.
10831088 """
10841089 if not self ._standing_dialog :
10851090 raise Exception ("Cannot pause dialog, no standing dialog exists" )
10861091 return self ._standing_dialog .pause ()
10871092
10881093 @contextmanager
10891094 def resume_dialog (self , dialog_data ):
1090- # FIXME document, test, NOTE NO UNTRUSTED SOURCES
1095+ """
1096+ Create a dialog based on the data of a previous dialog.
1097+
1098+ **Warning:** `dialog_data` **MUST NOT** be from an untrusted source such as user-controlled
1099+ or client-side state or you will have a major security issue.
1100+ """
10911101 if self ._standing_dialog :
10921102 raise Exception ("Cannot resume dialog, existing standing dialog" )
10931103 self ._standing_dialog = FinTSDialog .create_resume (self , dialog_data )
0 commit comments