wiki:devel:security
Различия
Показаны различия между двумя версиями страницы.
Предыдущая версия справа и слеваПредыдущая версияСледующая версия | Предыдущая версия | ||
wiki:devel:security [2025/01/03 17:28] – [Typical Vulnerability Examples] vladpolskiy | wiki:devel:security [2025/01/03 17:48] (текущий) – [Reporting Security Issues] vladpolskiy | ||
---|---|---|---|
Строка 164: | Строка 164: | ||
</ | </ | ||
- | ===== Cross Site Request Forgery | + | ===== Подделка межсайтовых запросов |
- | This vulnerability often appears into plugins due to the lack of understanding of this issue, often confused with the XSS. | + | Эта уязвимость часто появляется в плагинах из-за отсутствия понимания этой проблемы, ее часто путают с XSS. |
- | Cross Site Request Forgery refers to an attack where the victim' | + | Подделка межсайтовых запросов относится к атаке, при которой вредоносный сайт обманывает браузер жертвы, |
- | ===Adding security token=== | + | ===Добавление токена безопасности=== |
- | DokuWiki | + | DokuWiki |
- | It is your resposibility as the plugin author to actually check the token before executing authorized actions using the [[xref>checkSecurityToken()]] | + | Вы как автор плагина несете ответственность за фактическую проверку токена перед выполнением авторизованных действий с использованием функции |
==See also== | ==See also== | ||
- | * [[wp> | + | * [[wp> |
- | * [[https:// | + | * [[https:// |
- | ==== Typical Vulnerability Example | + | ==== Типичный пример уязвимости |
- | Below is the simplest example to start. You may have a more complicated plugin of your own to secure, here is just a simple example based on form. | + | Ниже приведен простейший пример для начала. У вас может быть более сложный плагин для защиты, вот простой пример на основе формы. |
- | Imagine you want to know something which can be answered to Yes or No, you would have a form of this type: | + | Представьте, что вы хотите узнать что-то, |
<code html> | <code html> | ||
Строка 196: | Строка 196: | ||
</ | </ | ||
- | Then you process this form as follows: | + | Затем вы обрабатываете эту форму следующим образом: |
<code php> | <code php> | ||
Строка 206: | Строка 206: | ||
</ | </ | ||
- | So a user is connected to answer this question, but he doesn' | + | Итак, пользователь подключен, |
- | Now the user is visiting a malicious website, one which know, or not, that the user may be connected to your DokuWiki. | + | |
<code html> | <code html> | ||
Строка 213: | Строка 212: | ||
</ | </ | ||
- | What will the user's browser do then? | + | Что тогда будет делать браузер пользователя? |
- | The browser will process this image as any other and will send a request to this URL. Your plugin will then see that '' | + | Браузер обработает это изображение как любое другое и отправит запрос на этот |
- | That's one of the examples of CSRF. Now, how to fix this security hole? | + | Это один из примеров |
- | ==== Prevent | + | ==== Предотвращение |
- | Remember your form above? Let's add an input in it: | + | Помните вашу форму выше? Давайте добавим в нее ввод: |
<code html> | <code html> | ||
Строка 232: | Строка 231: | ||
</ | </ | ||
- | Do you see the first input? Yes? Good. Now you have to check the security token when you receive the form, before processing it: | + | Видите первый ввод? Да? Хорошо. Теперь вам нужно проверить токен безопасности при получении формы, перед ее обработкой: |
<code php> | <code php> | ||
Строка 242: | Строка 241: | ||
</ | </ | ||
- | As the malicious website will never find the value of the " | + | Поскольку вредоносный веб-сайт никогда не найдет значение скрытого ввода «sectok», ваша форма больше не уязвима для |
- | **Note:** If the security token is not valid, the '' | + | **Примечание**: Если токен безопасности недействителен, '' |
- | ===== Remote Code Inclusion | + | ===== Удаленное включение кода |
- | This attack allows an attacker to inject | + | Эта атака позволяет злоумышленнику внедрить код |
- | **Always filter any input** that will be used to load files or that is passed as an argument to external commands. | + | **Всегда фильтруйте любые входные данные**, которые будут использоваться для загрузки файлов или которые передаются в качестве аргумента внешним командам. |
- | ===== Information leaks ===== | + | ===== Утечка информации |
- | This attack may lead to the exposure of files that should usually be protected by DokuWiki' | + | Эта атака может привести к раскрытию файлов, |
- | **Always filter any input** that will be used to load files or that is passed as an argument to external commands. | + | **Всегда фильтруйте любые входные данные, |
- | **Always use DokuWiki' | + | **Всегда используйте функции проверки |
- | ===== SQL injection | + | ===== SQL-инъекция |
- | This attack is rarely relevant in DokuWiki | + | Эта атака редко актуальна в DokuWiki, поскольку база данных не используется. Однако, |
- | More info: | + | Дополнительная информация: |
- | * [[wp>SQL injection]] | + | * [[wp>SQL injection|SQL-инъекция]] |
- | ===== Reporting Security Issues | + | ===== Сообщение о проблемах безопасности |
- | If you encounter an issue with a plugin please inform the author of the plugin via email, optionally putting | + | Если у вас возникли проблемы с плагином, сообщите об этом автору плагина по электронной почте, при желании указав |
- | Additionally a '' | + | Дополнительно к [[wiki:lugin: |
- | Once the issue was fixed and a new release was made, this field should be removed again. | + | После устранения проблемы и выпуска новой версии это поле следует снова удалить. |
wiki/devel/security.1735914485.txt.gz · Последнее изменение: — vladpolskiy