شعار Auditing Csrf And Unsafe State Changes

Auditing Csrf And Unsafe State Changes

مؤسسة
UnboundCompute
auditing-csrf-and-unsafe-state-changes

Audit state-changing endpoints for cross-site request forgery, where a request that rides the victim's ambient cookies is authorized on that session alone with no unpredictable, session-bound proof the request came from the app, letting an attacker page trigger the change as the victim. Use when reviewing forms and actions that modify data, change settings, move funds, or alter access, and how each is protected. Covers missing or unvalidated tokens, tokens not bound to the session, cookie-only same-site reliance and its gaps, state-changing GET requests, and content-type or method-override assumptions. The cross-site request on the victim's session is the source, the state-changing endpoint is the sink, and acting without unpredictable session-bound proof of origin is the bug.

نظرة عامة

الناشرUnboundCompute
المستودعsecurity-agent-skills
اسم المهارةauditing-csrf-and-unsafe-state-changes
النجوم
27
التفريعات
8
الملفات المرفقة
تعليمات فقط
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • مكتفية بذاتها

    كل ما يحتاجه النموذج موجود في التعليمات — لا ملفات إضافية لمزامنتها.

  • مفتوحة المصدر

    نشرها UnboundCompute على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Auditing Csrf And Unsafe State Changes في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى «الإضافات» ثم «المهارات».
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-csrf-and-unsafe-state-changes
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات ← المهارات ← إضافة مهارة ← من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/UnboundCompute/security-agent-skills.git /tmp/security-agent-skills
mkdir -p .claude/skills
cp -r /tmp/security-agent-skills/skills/auditing-csrf-and-unsafe-state-changes .claude/skills/auditing-csrf-and-unsafe-state-changes
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Auditing Csrf And Unsafe State Changes في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج مهارة Auditing Csrf And Unsafe State Changes تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Auditing Csrf And Unsafe State Changes بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تستهلك تعليمات المهارة أي توكنات ما دامت المهارة غير مستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

Auditing CSRF and unsafe state changes: when the victim's cookies do the attacker's work

A browser attaches a site's cookies to every request to that site, whoever caused the request. So when a state-changing endpoint authorizes an action on the session cookie alone, an attacker's page can submit a form or fire a request to that endpoint, the victim's browser attaches the session, and the change happens as the victim without them ever intending it. The defense is proof that the request originated from the app's own pages and not a foreign one: an unpredictable token bound to the session that an attacker cannot guess or read cross-origin, or a cookie policy that withholds the cookie on cross-site requests. The bug is a state change that trusts the cookie and asks for nothing else. You find it by listing every action that mutates state and checking what, beyond the cookie, each one requires.

When to use

  • An endpoint changes data, settings, access, or funds and is authorized by a session cookie.
  • Forms or actions rely on a token, and you need to confirm it is present, validated, and session-bound.
  • The app relies on same-site cookie behavior, custom headers, or content-type as its only cross-site guard.

Scope check

Test cross-site request forgery only against applications you own or are authorized to assess, using test accounts and a benign state change you can observe and reverse, never triggering a real irreversible action on another user. A confirmed case performs a real mutation as the victim, so stay within the authorized scope. If you can't name the authorization, stop.

The loop

  1. Establish what each state change requires beyond the cookie first. For every mutating endpoint, determine whether it demands an unpredictable, session-bound token that it validates, or relies on a fully-enforced same-site cookie, or nothing at all. This is the false-positive killer: an endpoint that validates a session-bound token on every mutation, or is reached only with a cookie the browser withholds cross-site, is defended, while one authorized on the ambient cookie alone is not. Name the requirement before building a cross-site request.

  2. Enumerate every state-changing action. List the endpoints that modify data, change settings or access, move funds, or alter the account, including ones reachable by GET. Each is a candidate sink; read-only endpoints are not the target here.

  3. Judge the token if there is one. A token defends only if it is present on the request, unpredictable, bound to the session so one user's token does not validate another's, validated server-side on every mutation, and not readable cross-origin or reflected back to an attacker. Decide whether the token is missing, static, shared, unvalidated, or improperly bound.

  4. Judge the same-site and header reliance. Same-site cookie behavior mitigates cross-site sends but has gaps: the default still permits top-level navigations for some methods, subdomains and same-site siblings are not cross-site, and a permissive setting or an older client removes the protection. A custom-header requirement defends only if the endpoint rejects the request without it and the header cannot be set cross-origin. Decide whether the reliance actually withholds authorization cross-site.

  5. Check the method and content-type assumptions. A state change reachable by GET is forgeable with a simple link or image; an endpoint that assumes a non-simple content-type but also accepts a simple one, or honors a method-override parameter, can be reached by a cross-site form. Determine whether the endpoint enforces a safe method and rejects the simple, cross-site-submittable request shapes.

  6. Confirm and record. Confirm by issuing the state change from a foreign origin with the victim's session present and no valid token, on test accounts on an isolated instance, and observing the mutation. Kill the lead if a session-bound token is validated on every mutation, if the cookie is genuinely withheld cross-site for this request shape, if the endpoint rejects the cross-site-submittable form, or if the endpoint changes no state. Record the endpoint, the missing proof, the request shape, and the change effected, or set a kill_reason.

Where CSRF leaks

  • The cookie is ambient. The browser sends it on any request to the site, so a state change authorized on the cookie alone is forgeable; the finding is the absence of a second, unpredictable, session-bound proof.
  • Tokens must be bound and validated. A token that is static, shared across users, optional, or unchecked is decoration; only a per-session unpredictable token validated on every mutation is a defense.
  • Same-site has gaps. The default policy still allows some cross-site top-level sends, and siblings and subdomains are not cross-site, so same-site reliance alone leaves specific shapes forgeable.
  • GET that mutates is the easy case. A state change reachable by GET is triggered by an image or a link with no form at all, so safe methods for mutations matter.
  • Content-type and override assumptions break. An endpoint that trusts a non-simple content-type but also accepts a simple one, or honors a method override, is reachable by a plain cross-site form.

Worked example (a confirm and a kill)

Confirm. An email-change endpoint accepts a form post and authorizes it on the session cookie alone, with no token and a cookie policy that permits the cross-site send. A page on a foreign origin auto-submits the form while the victim is logged in, and the account email changes to the attacker's on test accounts on an isolated instance. Confirmed cross-site request forgery on an account-takeover action, high, remediation = require an unpredictable session-bound token validated on every mutation, set the session cookie to withhold on cross-site requests, and reject state changes issued by GET or simple cross-site forms.

Kill. The same endpoint requires a per-session unpredictable token that it validates server-side on every submission, rejects the request when the token is absent or belongs to another session, is reachable only by a safe method with a cookie the browser withholds cross-site, and refuses the simple-content-type form. A cross-origin submission without the token is rejected and no change occurs. Killed, kill_reason = "every mutation requires a validated session-bound token and the cookie is withheld cross-site for this shape; a foreign origin cannot forge the request with the victim's ambient cookie."

Rationalizations to reject

  • "The user is authenticated, so the request is theirs." -> Authentication rides on the ambient cookie the browser sends for any origin; the missing piece is proof the request came from your pages, not a foreign one.
  • "We set the cookie same-site." -> That helps but has gaps for top-level sends, siblings, and subdomains, and evaporates on a permissive setting or older client; confirm it withholds the cookie for this exact shape, and prefer a token as well.
  • "There is a token on the form." -> Confirm it is unpredictable, bound to the session, and validated on every mutation; a static, shared, optional, or unchecked token defends nothing.
  • "It requires a JSON content-type." -> If the endpoint also accepts a simple content-type or honors a method override, a cross-site form reaches it; enforce the content-type and reject simple submissions.
  • "It is only a preference change." -> Preferences include email, recovery address, and access settings that lead to takeover; audit every state change, not only the obviously sensitive ones.

Executing this in practice

You need every state-changing endpoint, what each requires beyond the session cookie, the token's unpredictability and session binding and whether it is validated on every mutation, the cookie policy's behavior for each request shape, and whether GET or simple cross-site forms reach any mutation. For each, decide whether a foreign origin can drive the change with only the ambient cookie. Reading the token validation and cookie policy settles most leads; issuing the change from a foreign origin on test accounts on an isolated instance settles the rest.

Related

  • auditing-session-lifecycle-and-fixation - the session cookie that CSRF abuses is the same one that skill audits for lifecycle and fixation, so the cookie's flags and scope are examined together.
  • auditing-cors-and-cross-origin-trust - the mirror question of which cross-origin callers may act, from the server's own headers rather than the browser's ambient cookie.
  • hunting-broken-object-level-authorization - CSRF forges a request the victim is allowed to make, while that skill hunts requests the caller should not be allowed to make; together they cover who may change what.
  • reviewing-rate-limiting-and-abuse-controls - a mutating endpoint without origin proof is also worth checking for abuse volume, so the two controls are assessed on the same actions.
  • FINDING-SCHEMA.md - source = the cross-site request on the victim's session, sink = the state-changing endpoint, evidence = the mutation performed from a foreign origin without valid session-bound proof, on test accounts on an isolated instance.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Auditing Csrf And Unsafe State Changes؟

Audit state-changing endpoints for cross-site request forgery, where a request that rides the victim's ambient cookies is authorized on that session alone with no unpredictable, session-bound proof the request came from the app, letting an attacker page trigger the change as the victim. Use when reviewing forms and actions that modify data, change settings, move funds, or alter access, and how each is protected. Covers missing or unvalidated tokens, tokens not bound to the session, cookie-only same-site reliance and its gaps, state-changing GET requests, and content-type or method-override...

لماذا تستخدم Auditing Csrf And Unsafe State Changes على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Auditing Csrf And Unsafe State Changes عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Auditing Csrf And Unsafe State Changes في TypingMind؟

في TypingMind، افتح «الإضافات»، ثم «المهارات»، ثم اختر «التثبيت من GitHub» والصق https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-csrf-and-unsafe-state-changes. يقرأ TypingMind ملف SKILL.md الخاص بالمهارة ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Auditing Csrf And Unsafe State Changes؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Auditing Csrf And Unsafe State Changes؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Auditing Csrf And Unsafe State Changes معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Auditing Csrf And Unsafe State Changes مجانية؟

نعم. نشرها UnboundCompute على GitHub بموجب ترخيص MIT. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا الإخبارية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇