How to disallow pickle serialization in celery

前端 未结 3 1653
刺人心
刺人心 2021-02-01 13:41

Celery defaults to using pickle as its serialization method for tasks. As noted in the FAQ, this represents a security hole. Celery allows you to configure how tasks get seria

3条回答
  •  攒了一身酷
    2021-02-01 14:29

    I got an answer from the celery-users mailing list (From Ask Solem to be specific). Add these two lines to the config (celeryconfig/settings):

    from kombu import serialization
    serialization.registry._decoders.pop("application/x-python-serialize")
    

提交回复
热议问题