חזרה לבלוגטכני

LangChain CVE-2025-68664: כיצד PII דולף דרך ה-RAG Pipeline שלך

CVSS 9.3. פונקציות הסריאליזציה של LangChain חושפות משתני סביבה וסודות ל-LLMs בשליטת תוקפים. כיצד לזהות ולתקן דליפות PII.

March 16, 20268 דקות קריאה
LangChainRAG pipelineCVEPII leakagedeveloper securityAPI keysLLM security

LangChain CVE-2025-68664: כיצד PII דולף דרך ה-RAG Pipeline שלך

מעודכן ל-2026.

נמצא פגם קריטי ב-LangChain בסוף 2025. ה-CVE הוא CVE-2025-68664. ניקוד CVSS הוא 9.3 (קריטי).

הוא מכוון לקוד הסריאליזציה של LangChain.

מה עושה CVE-2025-68664

ל-LangChain יש שתי פונקציות סריאליזציה: dumps() ו-dumpd(). הן ממירות אובייקטי Python לטקסט.

הפגם נמצא בטיפול בסגירות.

כאשר LangChain מבצע סריאליזציה ל-callable, הוא לוכד את הקשר הסגירה.

תוקף ששולט בתגובת ה-LLM יכול להפעיל את dumps(). הפונקציה אז קוראת משתני סביבה מהתהליך של Python.

התוצאה היא חשיפת נתונים. מפתחות API, מחרוזות בסיס נתונים, סודות JWT, ואישורי AWS עלולים להופיע בפלט המודל.

תוקף שמזריק טקסט למסמך מקור RAG יכול לקרוא את הסודות שלך בפרודקשן.

גרסאות מושפעות: LangChain מתחת ל-0.3.22 (Python). גרסה 0.3.22 מכילה את התיקון.

נתוני PyPI מראים שימוש נרחב בגרסאות ישנות יותר עד מרץ 2026.

כיצד PII דולף ב-RAG Pipelines

CVE-2025-68664 הוא דרמטי. אבל הוא רק מקרה אחד של בעיה רחבה יותר.

נתונים דולפים דרך RAG pipelines באופן קבוע. לא נדרש תוקף.

הנה הגדרת RAG ארגונית סטנדרטית.

ראשית, קליטה. אתה מאנדקס מסמכי חברה בחנות וקטורים. חשוב על כרטיסי תמיכה, מיילים של לקוחות, חוזים ורשומות HR.

חנויות וקטורים נפוצות הן Pinecone, Weaviate ו-pgvector.

לאחר מכן, שליפה. משתמש שואל שאלה. המערכת שולפת את חמשת הנתחים הרלוונטיים ביותר מהחנות.

ואז, יצירה. הנתחים האלה הולכים ל-LLM — GPT-4o, Claude, או Gemini — כהקשר.

שלב שניים הוא הבעיה. נתחים שנשלפו מחזיקים כל מה שמסמכי המקור הכילו. זה כולל:

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

הנתונים האלה הולכים ל-LLM כמו שהם. הם יכולים להופיע בפלט המודל.

הם נרשמים ביומן על ידי ספק ה-LLM. הם יושבים בהיסטוריית השיחה שלך. הם זורמים לסטאק ה-observability שלך.

לא נדרשת תקיפה. כך RAG עובד לפי תכנון. התכנון יוצר סיכון פרטיות אמיתי.

68 דפוסי סוד בחנויות מסמכים ארגוניות

כלי אבטחה עוקבים אחרי 68 דפוסי סוד ידועים. הם מופיעים לעיתים קרובות יותר ממה שצוותים מצפים.

הנה הנפוצים ביותר.

  • מזהי מפתח גישה AWS (AKIA...)
  • מפתחות API של OpenAI (sk-...)
  • מפתחות API של Anthropic (sk-ant-...)
  • URI של בסיסי נתונים (postgresql://user:password@host/db)
  • טוקני JWT (headers מקודדים ב-base64)
  • Personal Access Tokens של GitHub
  • מפתחות סוד של Stripe (sk_live_...)
  • מפתחות API של SendGrid
  • מזהי חשבון Twilio וטוקני אימות
  • בלוקי PEM של מפתחות פרטיים

כרטיס תמיכה עשוי להכיל מפתח API של לקוח מ-session debug.

חוזה עשוי לכלול אישורי בסיס נתונים מהעברה טכנית.

קובץ config שאונדקס בטעות יכול לחשוף חנות סודות שלמה.

כאשר קבצים אלה נכנסים לחנות וקטורים ללא ניקוי, כל שאילתה יכולה להעביר את הסודות ל-LLM.

הם עלולים להגיע גם למשתמש הקצה.

תקן את זה: בצע אנונימיזציה לפני Embedding

הגישה הנכונה מבצעת אנונימיזציה למסמכים לפני חלוקה ו-embedding.

שלב זה נדרש לכל מערכת שמטפלת בנתוני לקוחות.

הנה דוגמת Python באמצעות anonym.legal API:

import requests
import os

ANONYM_API_KEY = os.environ["ANONYM_API_KEY"]
ANONYM_BASE_URL = "https://anonym.legal/api"

def anonymize_before_embedding(text: str) -> tuple[str, dict]:
    """בצע אנונימיזציה ל-PII לפני embedding."""
    response = requests.post(
        f"{ANONYM_BASE_URL}/presidio/anonymize",
        json={
            "text": text,
            "language": "en",
            "anonymizers": {
                "DEFAULT": {"type": "replace", "new_value": "[REDACTED]"},
                "PERSON": {"type": "mask", "masking_char": "*", "chars_to_mask": 4, "from_end": False},
                "EMAIL_ADDRESS": {"type": "replace", "new_value": "[EMAIL]"},
                "PHONE_NUMBER": {"type": "replace", "new_value": "[PHONE]"},
                "CRYPTO": {"type": "replace", "new_value": "[SECRET]"},
                "URL": {"type": "keep"},
            }
        },
        headers={"Authorization": f"Bearer {ANONYM_API_KEY}"}
    )
    result = response.json()
    return result["text"], result.get("items", [])


def build_rag_index(documents: list[str], vectorstore):
    """בנה אינדקס RAG עם מסמכים נקיים בלבד."""
    anonymized_docs = []
    for doc in documents:
        clean_text, entities = anonymize_before_embedding(doc)
        anonymized_docs.append(clean_text)
        print(f"הוסרו {len(entities)} ישויות PII מהמסמך")
    vectorstore.add_texts(anonymized_docs)

anonym.legal API מכסה יותר מ-285 סוגי ישויות. שמות, כתובות דואר אלקטרוני, מספרי טלפון, מספרי זהות לאומיים, מפתחות API ו-URI של בסיסי נתונים כולם נתפסים.

שום דבר רגיש לא מגיע לחנות הוקטורים. ולכן שום דבר רגיש לא יכול לדלוף למשתמשים.

ראה את מדריך המפתחים לדפוסי הגדרה של LangChain ו-LlamaIndex.

תקן את CVE-2025-68664 עכשיו

אם אתה מריץ LangChain מתחת ל-0.3.22, עדכן עכשיו:

pip install "langchain>=0.3.22" "langchain-core>=0.3.22"

לאחר ה-patch, בדוק את תצורות ה-chain שלך לסיכון הזרקה. הנה שלושה צעדים לנקוט.

ראשית, אמת נתחים שנשלפו. עשה זאת לפני שהם מגיעים ל-LLM.

הסר תוכן שתואם לדפוסי הזרקה כגון ignore previous instructions, system:, או <INST>.

שנית, בצע אנונימיזציה לפני embedding. זה מצמצם את משטח התקיפה.

אם הזרקה אכן מתרחשת, הנתונים הרגישים לא נמצאים שם לחילוץ.

שלישית, הגבל הרשאות chain. LangChain chains לא צריכים לקרוא משתני סביבה מעבר למה שהם זקוקים לו.

השתמש בחשבון שירות עם הרשאה מינימלית.

המתמטיקה פשוטה

ניקוד CVSS הוא 9.3. התיקון הוא קריאת API אחת לכל מסמך.

השילוב של CVE-2025-68664 וסיכון נתוני RAG כללי הוא אחריות אמיתית.

הפתרון ברור: בצע אנונימיזציה בעת קליטה, לא בזמן שאילתה.

בדוק את סקירת האבטחה והציות לדרישות RAG ארגוניות.

מקורות

  • NVD CVE-2025-68664, CVSS 9.3, פגיעות סריאליזציה של LangChain
  • הודעת אבטחה של LangChain, langchain-ai/langchain GitHub, 2025
  • OWASP LLM Top 10: LLM01 Prompt Injection, LLM06 Sensitive Information Disclosure
  • תיעוד סוג ישות של anonym.legal — יותר מ-285 סוגי ישויות נתמכים

מוכן להגן על הנתונים שלך?

התחל לאנונימיזציה של PII עם 285+ סוגי ישויות ב-48 שפות.

About this page

We update this page when our platform or the law changes.

Read our founder note for how we work.

Each change shows up in the timestamp at the top.

Related reading

We follow these rules

  • GDPR (EU 2016/679).
  • ISO/IEC 27001:2022.
  • NIS2 (EU 2022/2555).
  • HIPAA safe harbor under 45 CFR § 164.514(b)(2).

Our promise

We do not sell your data.

We do not train models on your text.

We store your files in Germany.

You can delete your account at any time.

You own your work.

Where we run

Our servers live in Falkenstein, Germany.

We use Hetzner. They hold ISO 27001 certification.

All data stays in the EU.

Backups run every day.

Need help?

Email support@anonym.legal.

We reply within one business day.

How we test

We run a full check suite on every release.

Each surface gets its own sweep script and report.

Human reviewers spot-check the output each week.

We track recall and precision on a labelled set.

Bad runs block the deploy.

What we never do

  • We never sell your information to third parties.
  • We never train models on what you upload.
  • We never keep your work after you delete it.
  • We never share keys with any outside firm.
  • We never run ads inside the product.

Plans in plain words

We sell credits, not seats.

One credit covers one short job.

Long jobs use a few credits each.

You can top up at any time.

Unused credits roll over each month.

Read the plans page for current rates.

Who built this

A small team of engineers and lawyers built this.

We ship from Europe and work in the open.

Our founder note spells out why we started.

Where to start

How the parts fit

A browser add-on cleans text inside Chrome.

A Word plug-in handles drafts in Office.

A small desktop tool works on whole folders.

An agent protocol link feeds large models safely.

All four share one core engine and one rule set.

Words from our team

We started this work after a lunch about cookies.

One friend kept getting odd ads on her phone.

We asked why a court file leaked through a draft.

We sketched the first build on a napkin that week.

By month three we had a tiny demo for a friend.

She used it on her first case the next day.

Common questions we hear

Can the tool read scanned PDFs? Yes, with OCR.

Does it work on long files? Yes, in small chunks.

Can I roll my own rule set? Yes, save it as a preset.

Does it run offline? The desktop build runs offline.

Do you keep my files? No, the cloud build wipes after each run.

Will it learn from my work? No, we never train on inputs.

A short tour of the workflow

Upload a file or paste a snippet of prose.

Pick the entities you want gone from the draft.

Choose a method: replace, mask, hash, encrypt, or redact.

Press run and watch the side panel show each hit.

Skim the result and tweak any rule that misfired.

Save the cleaned file or send it to a teammate.