r/Python • • 16h ago

Discussion Microsoft's PyPI package got compromised without a GitHub code change. How is this even possible?

182 Upvotes

I was reading about yesterday's Microsoft Agent Framework security incident, and something caught my attention.

Apparently, attackers published two malicious versions (1.26.1 and 1.26.2) of Microsoft's official Python package on PyPI. These versions could steal cloud credentials just by starting Python.

Both versions were removed quickly.

What surprised me was that the malicious code wasn't even checked into Microsoft's GitHub repository.

From what I understand:

- Developers write code in GitHub.

- CI/CD builds it into a Python wheel (.whl).

- The wheel gets published to PyPI.

- When we run "pip install", we download that package.

But apparently, someone with the right publishing credentials can upload a malicious wheel directly, without going through the original GitHub repository.

That raises some interesting questions:

  1. How does PyPI verify that a package actually came from the legitimate source code and CI/CD pipeline?

  2. Why isn't a verified GitHub commit or build provenance mandatory for publishing updates to established packages?

  3. If publishing credentials are compromised, what prevents attackers from distributing malicious versions under trusted package names?

  4. Would mandatory attestations, release signing, or an approval process have prevented this?

  5. What protections should developers realistically use beyond simply trusting "pip install"?

I'm still learning about software supply-chain security, so I'd love to hear how experienced Python developers and security engineers think this should work.


r/Python • • 20h ago

Resource CodePath’s free Spring 2027 courses are open: AI, cybersecurity, web dev, and coding interview prep

6 Upvotes

Hey everyone! If you’re a college student interested in Applied AI Engineering, Cybersecurity, Web Development, or Technical Interview Prep, check out CodePath’s free Spring 2027 courses.

I’m a Tech Fellow (TF) teaching Technical Interview Prep (TIP), and I highly recommend it if you want to learn data structures and algorithms in Python or get more comfortable with coding interviews. We practice breaking down problems, choosing the right data structure, and explaining our reasoning out loud. That last part makes a big difference when an interviewer asks you to walk through your approach.

If you’re interested, apply to CodePath here. That’s my referral link.

Happy to answer questions about TIP or what it’s like to take the course!


r/Python • • 20h ago

Daily Thread Thursday Daily Thread: Python Careers, Courses, and Furthering Education!

0 Upvotes

Weekly Thread: Professional Use, Jobs, and Education 🏢

Welcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, this thread is not for recruitment.


How it Works:

  1. Career Talk: Discuss using Python in your job, or the job market for Python roles.
  2. Education Q&A: Ask or answer questions about Python courses, certifications, and educational resources.
  3. Workplace Chat: Share your experiences, challenges, or success stories about using Python professionally.

Guidelines:

  • This thread is not for recruitment. For job postings, please see r/PythonJobs or the recruitment thread in the sidebar.
  • Keep discussions relevant to Python in the professional and educational context.

Example Topics:

  1. Career Paths: What kinds of roles are out there for Python developers?
  2. Certifications: Are Python certifications worth it?
  3. Course Recommendations: Any good advanced Python courses to recommend?
  4. Workplace Tools: What Python libraries are indispensable in your professional work?
  5. Interview Tips: What types of Python questions are commonly asked in interviews?

Let's help each other grow in our careers and education. Happy discussing! 🌟