bitrix-security

Enforce CSRF, SSRF, SQL injection, XSS, and access controls in Bitrix applications.

33|3|Updated Jun 5, 2025
One-click install
npx skills add https://github.com/bxmaximum/bitrix_ai_challenge --skill bitrix-security
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bitrix-security
Source: https://github.com/bxmaximum/bitrix_ai_challenge/tree/main/.agents/skills/bitrix-security
Command: npx skills add https://github.com/bxmaximum/bitrix_ai_challenge --skill bitrix-security

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Bitrix security concerns span CSRF, SSRF, SQL injection, and XSS risks, plus fragile permission checks and insecure data handling. This Skill consolidates best practices to help developers design safe Bitrix applications, audits, and admin actions with consistent controls.

Core Features & Use Cases

  • CSRF protection using standard filters and sessid checks for forms and AJAX.
  • SSRF protection when HttpClient makes external requests, with host/URL validation and timeouts.
  • SQL injection defense across ORM and raw queries, with safe expressions and parameterization.
  • XSS mitigation through proper escaping, input/output sanitization, and secure data handling.
  • Permission enforcement and encryption of sensitive fields (CryptoField, Cipher) to protect personal data.
  • Real-world use cases: securing admin panels, REST-like endpoints, and user input workflows.

Quick Start

Enable CSRF protection on all POST actions, validate inputs at every boundary, and enforce user permissions before sensitive operations.

Frequently Asked Questions about bitrix-security

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent CSRF in Bitrix forms and AJAX requests?

Prevent CSRF in Bitrix by applying standard filters and sessid checks to all POST actions. This validates session tokens for forms and AJAX, ensuring unauthorized cross-site requests are blocked before execution.

How do I protect Bitrix HttpClient from SSRF vulnerabilities?

Protect Bitrix HttpClient from SSRF by validating target hosts and URLs before external requests, enforcing strict timeouts, and restricting internal network access to prevent unauthorized server-side resource fetching.

What is the best way to avoid SQL injection in Bitrix ORM queries?

Avoid SQL injection in Bitrix ORM by using parameterized queries and safe SqlExpression or ExpressionField usage. Never concatenate raw user input directly into database queries or dynamic expressions.

How do I mitigate XSS risks when rendering user input in Bitrix?

Mitigate XSS risks in Bitrix by applying htmlspecialcharsbx escaping and output sanitization. Validate inputs at every boundary and ensure secure data handling before rendering user-provided content.

How do I encrypt sensitive personal data in Bitrix applications?

Encrypt sensitive personal data in Bitrix using CryptoField and Cipher-based encryption. This protects stored fields by applying cryptographic controls directly within the ORM entity definitions.

Does this Bitrix security approach require any external dependencies?

No, this Bitrix security approach requires no external dependencies. It centralizes native framework controls including CSRF filters, HttpClient protections, safe ORM expressions, and built-in encryption mechanisms.