Education

MCP Security Fundamentals Course

by freeCodeCamp.org

Share:

📚 Main topics

  • MCP and its architectureThe course explains how MCP connects AI hosts and clients to servers and backend systems, adding agents as a new API consumer with decision-making capabilities and new trust boundaries. 13:28
  • The lethal trifectaAn agent becomes structurally vulnerable to data exfiltration when it can access private data, ingest untrusted content, and communicate externally; removing any one of these capabilities can break the attack path. 22:19
  • OWASP MCP Top 10The course examines token and secret exposure, scope creep, tool poisoning, supply-chain tampering, command injection, intent-flow subversion, weak authentication, missing audit telemetry, shadow servers, and context oversharing. 33:12
  • Real-world incidentsExamples include a malicious Postmark MCP that BCCed sent mail, poisoned tool descriptions that redirected agents, a vulnerable MCP Inspector, and cross-tenant data leakage in Asana. 2:03

✨ Key takeaways

  • Credentials and permissionsStore secrets in a vault, use short-lived and narrowly scoped tokens, enforce least privilege, and prevent client-token pass-through to downstream services. 40:57
  • Trust tools and dependenciesVerify and pin tool schemas and dependencies, inspect descriptions and defaults, and inventory MCP servers instead of relying on unreviewed or unknown sources. 56:01
  • Constrain execution and retrieved contentAvoid building shell commands from untrusted input, use structured arguments and parameterized queries, and treat retrieved text as data rather than instructions. 1:13:11
  • Log and isolateKeep structured, tamper-evident tool-call logs, establish behavioral baselines, and enforce tenant isolation and context expiration. 1:42:12

🧠 Lessons learned

  • Agents amplify existing risksAI agents can act autonomously and at machine speed, so familiar weaknesses in APIs, authentication, permissions, and dependencies can have a larger and faster impact. 20:11
  • Legitimate actions can conceal attacksA model may follow poisoned context or tool metadata as designed, and malicious activity can appear as valid tool use; prompt tweaks alone cannot replace structural safeguards. 27:31
  • Unknown infrastructure is a security gapUnregistered MCP servers can bypass central identity, monitoring, and governance, making continuous discovery and a trusted registry essential. 43:46
  • Visibility enables responseWithout usable audit records, organizations may not detect or reconstruct data theft, unexpected actions, or agent behavior drift. 33:52

🏁 Conclusion/next steps

  • Apply the minimum security baselineEstablish identity and access controls, isolation, trusted tooling, input and output validation, hardened deployment with oversight, and a trifecta scorecard for every agent. 2:01:55
  • Start with practical checksInventory MCP servers and agent permissions, move static keys to a vault, review shell calls and downstream token handling, enable structured logs, and test tenant isolation. 2:04:32
  • Build a continuous security programCombine discovery, governance, identity management, defense in depth, and detection and response, including rehearsals for compromised MCP servers. 2:06:04
  • Take the final quizThe instructor invites viewers to complete the course quiz to earn a certificate, LinkedIn badge, and CPE credits. 2:09:10

Transcript excerpt

0:00 Thanks for checking out this MCP security course. I'm Dan Barahona, founder of AI Security University. And this video is part of our suite of free courses and weekly live events. Stick around till the end of the video and you'll have a chance to take a final quiz, earn your certificate and badge, and get CPE credits. Visit AISEC.university to learn more. Our goal is to get you up to speed on the model context protocol and understand how to use it securely. My name is Dan Barahona. I'm your

0:30 instructor for this course. I'm also the founder of AI Security University where we provide high-quality AI security courses and content and training for everyone. I've been in cybersecurity for over 25 years and have taught over 150,000 students across AI and application security. Now, when MCP first came out, I was thoroughly confused by it. But I've actually come to really love the technology and respect the risks and best practices that come with it.

1:01 We'll start the course with an introduction to MCP. What is it? How does it work? Why is it making such a huge impact? How is it transforming our applications and what risks are coming with it? That's a lot right there. So, the core of the course is going to focus on MCP risks and what to do about them. We'll be covering the OWASP MCP top 10, arguably the best research and guidance out there on MCP security. I'll share what's in each of the top 10 with real-world examples to make it real and

🔒 The full, searchable transcript is available with Pro.

🔒 Unlock Premium Features

This is a premium feature. Upgrade to unlock unlimited Q&A, transcripts, mindmaps, and translations.

Questions & Answers

Common questions about this video

מהו פרוטוקול MCP, ומה הוא מאפשר לסוכני AI לעשות?

MCP הוא דרך לחבר סוכני AI לכלים ולמערכות חיצוניות. באמצעות שרתי MCP, סוכן יכול להשתמש ביכולות כמו חיפוש בכרטיסים ב-Jira, יצירת pull request ב-GitHub או שליחת הודעות דרך Slack, במקום להסתפק במענה על שאלות. 9:21

מהי "השלשה הקטלנית" (lethal trifecta) של סיכוני סוכנים?

השלשה מורכבת מגישה לנתונים פרטיים, חשיפה לתוכן לא מהימן ויכולת לתקשר עם גורמים חיצוניים. כשהשלושה מתקיימים יחד, סוכן עלול להיות פגיע מבנית להוצאת נתונים. הגנה מרכזית היא לנתק לפחות אחד משלושת המרכיבים. 22:51

איך מתקפת ה-Postmark הדגימה את הסיכון שבהתקנת שרת MCP לא רשמי?

בגרסה 1.0.16 של שרת MCP קהילתי ל-Postmark נוספה שורת קוד שהסתירה כתובת אימייל בשדה BCC. כתוצאה מכך, כל אימייל שנשלח דרך השרת הועתק גם לתוקף, תוך שימוש בהרשאות שהמשתמש העניק לכלי. 4:08

מהו הרעיון המרכזי מאחורי MCP1, ניהול לקוי של אסימונים וחשיפת סודות?

סוכנים זקוקים לאישורים כדי לפעול, אבל ברגע שמפתח או אסימון נכנסים להקשר של המודל, הם עלולים להישאר שם ולהיחשף דרך הקשר, לוגים או הנחיה זדונית. מומלץ לשמור סודות בכספת, להשתמש באסימונים קצרי־חיים ומוגבלי־היקף, ולמנוע מהסוד להיכנס להקשר של המודל. 33:44

מהי הרעלת כלים (tool poisoning), וכיצד היא עלולה לפגוע בסוכן?

הרעלת כלים מתרחשת כשהקוד, הפלט או ההגדרה של כלי MCP נפגעים. המודל קורא את שמות הכלים, הפרמטרים, ברירות המחדל והתיאורים כחלק מההקשר שלו, ולכן הוראה זדונית שמוטמעת במטא־נתונים יכולה להסיט אותו לפעולה מזיקה. 50:18

מה פירוש העיקרון "תוכן שנשלף הוא נתון, לא הוראה"?

תוכן שהסוכן קורא ממסמכים, דפי אינטרנט או בעיות ב-GitHub צריך להיחשב כלא מהימן, ולא כהוראה שעל הסוכן לציית לה. תיוג תוכן שנשלף כנתון לא מהימן עוזר למנוע ממנו להשתלט על מטרת הסוכן או להפעיל פעולות שלא ביקש המשתמש. 1:23:02

מדוע רישום וניטור של פעולות MCP חיוניים לאבטחה?

בלי רישום מובנה של זהות, כלי, פרמטרים וזמן, קשה לזהות פעילות חריגה או לשחזר אירוע. כדאי להזרים את הנתונים למערכת SIEM או XDR, להגן על הלוגים מפני שינוי ולהסוות מידע אישי ורגיש. 1:42:12

מהו צעד מעשי אחד שהמרצה ממליץ לבצע ביום שני בבוקר?

לבנות טבלת ניקוד לכל סוכן ולבדוק אם הוא ניגש לנתונים פרטיים, קורא תוכן לא מהימן ויכול לשלוח מידע החוצה. סוכן שמקיים את שלושת התנאים נמצא באזור הסיכון, ויש לזהות איזה מרכיב אפשר להסיר. 30:08

🔒 Unlock Premium Features

Access to Chat is a premium feature. Upgrade now to unlock unlimited studying tools.

🔒 Unlock Premium Features

Access to Mindmap is a premium feature. Upgrade now to unlock unlimited studying tools.

🔒 Unlock Premium Features

Access to Translation is a premium feature. Upgrade now to unlock unlimited studying tools.

Get unlimited summaries, Q&A, transcripts and more with Pro

Upgrade to Pro

Suggestions

🔒 Unlock Premium Features

Access to AI Suggestions is a premium feature. Upgrade now to unlock unlimited studying tools.