🇰🇷 한글 설명
Fickling은 Python 피클링 디컴파일러 및 정적 분석 도구입니다. Fickling 버전 0.1.6까지는 Python의 runpy 모듈을 안전하지 않은 것으로 처리하지 않습니다. 이렇게 때문에 runpy.run_path() 또는 runpy.run_module()을 사용하는 악의적인 피클은 Fickling에서 SUSPICIOUS로 분류되며, 사용자가 Fickling의 출력을 신뢰하여 피클을 안전하게 역직렬화할지 여부를 결정하는 경우, 이는 사용자가 공격자 제어 코드를 시스템에서 실행하도록 이어질 수 있습니다.
💡 쉬운 설명
Fickling은 Python 피클링 디컴파일러입니다. 피클링 버전 0.1.6까지는 일부 악성 코드를 제대로 감지하지 못합니다. 사용자가 이 버그를 이용하여 악성 코드를 실행할 수 있습니다. Fickling 0.1.7 버전으로 업데이트 하면 문제가 해결됩니다.
🇺🇸 원문 (English)
Fickling is a Python pickling decompiler and static analyzer. Fickling versions up to and including 0.1.6 do not treat Python’s runpy module as unsafe. Because of this, a malicious pickle that uses runpy.run_path() or runpy.run_module() is classified as SUSPICIOUS instead of OVERTLY_MALICIOUS. If a user relies on Fickling’s output to decide whether a pickle is safe to deserialize, this misclassification can lead them to execute attacker-controlled code on their system. This affects any workflow or product that uses Fickling as a security gate for pickle deserialization. This issue has been patched in version 0.1.7.
📍 영향받는 시스템
Fickling 버전 0.1.6 이하
⚔️ 공격 벡터
악성 피클을 생성하여 runpy 모듈을 악용
🛡️ 대응 방법
Fickling을 0.1.7 버전으로 업데이트
🔧 검증 코드
로컬 시스템에서 Python을 실행하여 Fickling 버전을 확인합니다. Fickling이 설치되어 있지 않으면 결과가 나타나지 않습니다. Python의 pkg_resources 모듈을 사용하여 설치된 패키지 목록을 확인하고, Fickling의 버전을 비교하여 취약점 여부를 판단합니다.
import pkg_resources
installed_packages = pkg_resources.working_set
installed_packages_list = sorted(['%s==%s' % (i.key, i.version) for i in installed_packages])
for installed_package in installed_packages_list:
if 'fickling' in installed_package:
package_version = installed_package.split('==')[1]
if package_version <= '0.1.6':
print('{"result": "취약", "reason": "Fickling 버전이 0.1.6 이하입니다."}')
else:
print('{"result": "양호", "reason": "Fickling 버전이 0.1.7 이상입니다."}')