{"id":475191,"date":"2025-09-16T08:52:51","date_gmt":"2025-09-16T08:52:51","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=475191"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=475191","title":{"rendered":"OWASP Top Ten 2021 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0430 Java. \u0418 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e SAST"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u043f\u0440\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 OWASP Top Ten 2021 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u0438\u0437\u043c\u0443 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439 Java \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 PVS-Studio. \u0422\u0430\u043a \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 Java \u043a\u043e\u0434\u0435 \u0438\u043b\u0438 \u0443\u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 OWASP Top Ten, \u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0433\u043e \u0447\u0442\u0435\u043d\u0438\u044f!<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/import.viva64.com\/docx\/blog\/1287_java_sast_ru\/image1.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/import.viva64.com\/docx\/blog\/1287_java_sast_ru\/image1.png 780w,&#10;       https:\/\/import.viva64.com\/docx\/blog\/1287_java_sast_ru\/image1.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041c\u044b \u2014 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f PVS-Studio, \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u043e\u0434\u043d\u043e\u0438\u043c\u0451\u043d\u043d\u044b\u0439 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0443\u0436\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 18 \u043b\u0435\u0442. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u044f\u0437\u044b\u043a\u0430\u043c\u0438 C\/C++, C# \u0438 Java. \u0421 \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0437\u0430\u043d\u044f\u043b\u0438\u0441\u044c \u0442\u0435\u043c, \u0447\u0442\u043e\u0431\u044b Java \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043c\u043e\u0433 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f SAST-\u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c. \u0412\u0435\u0434\u044c Java \u2014 \u043e\u0434\u0438\u043d \u0438\u0437 <a href=\"https:\/\/www.tiobe.com\/tiobe-index\/#top20\">\u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0435\u0439\u0448\u0438\u0445<\/a> \u044f\u0437\u044b\u043a\u043e\u0432, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<details class=\"spoiler\">\n<summary>SAST?<\/summary>\n<div class=\"spoiler__content\">\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/terms\/6631\/\">SAST<\/a> (Static Application Security Testing) \u2014 \u044d\u0442\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u043f\u043e\u0438\u0441\u043a\u0435 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0435\u0433\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0422.\u0435. <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/terms\/0046\/\">\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437<\/a>, \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u043f\u043e\u0438\u0441\u043a \u043e\u0448\u0438\u0431\u043e\u043a \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u041f\u041e \u0435\u0449\u0451 \u0434\u043e \u0435\u0433\u043e \u0432\u044b\u0445\u043e\u0434\u0430 \u0432 \u0440\u0435\u043b\u0438\u0437. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/terms\/6631\/\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<\/div>\n<\/details>\n<p>\u0418 \u043d\u0430\u0441 \u0447\u0430\u0441\u0442\u043e \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044e\u0442: &#171;\u041a\u0430\u043a \u0432\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0435 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440? \u0427\u0435\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0443\u0435\u0442\u0435\u0441\u044c?&#187; \u0412 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 SAST-\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 Java \u0434\u043b\u044f \u043d\u0430\u0441 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f OWASP Top Ten.<\/p>\n<p><a href=\"https:\/\/owasp.org\/www-project-top-ten\/\">OWASP Top Ten<\/a> \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 OWASP, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043e\u0431\u043e\u0439 \u0440\u0435\u0439\u0442\u0438\u043d\u0433 \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 web-\u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u043d \u0440\u0430\u0437 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u0442\u0447\u0451\u0442\u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u0432 \u0438 \u043a\u043e\u043d\u0441\u0443\u043b\u044c\u0442\u0430\u043d\u0442\u043e\u0432 \u043f\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, bug bounty \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 \u0438 \u0441\u0430\u043c\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 web-\u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a, \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a 2021 \u0433\u043e\u0434\u0443. \u041e\u0434\u043d\u0430\u043a\u043e \u0437\u0434\u0435\u0441\u044c \u0445\u043e\u0447\u0443 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u0432\u0440\u0435\u043c\u044f <a href=\"https:\/\/owasp.org\/www-project-top-ten\/#owasp-top-ten-2025\">\u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0439\u0442\u0438<\/a> OWASP Top Ten 2025. \u0412 \u043d\u0430\u0448\u0435\u043c \u0431\u043b\u043e\u0433\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0437\u043e\u0440, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u0438 \u0441\u043b\u0435\u0434\u0438\u0442\u0435.<\/p>\n<p><strong>\u0410 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e SAST \u0438 OWASP Top Ten \u0432\u0430\u0436\u043d\u044b \u0438 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b?<\/strong> \u0421 \u043a\u0430\u0436\u0434\u044b\u043c \u0433\u043e\u0434\u043e\u043c \u0440\u043e\u0441\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0441\u0442\u0451\u0442. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0435 \u043e\u0442 <a href=\"https:\/\/www.cve.org\/\">CVE<\/a>.<\/p>\n<details class=\"spoiler\">\n<summary>CVE?<\/summary>\n<div class=\"spoiler__content\">\n<p>CVE (Common Vulnerabilities and Exposures) \u2014 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u0449\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/terms\/6628\/\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<\/div>\n<\/details>\n<p>\u0417\u0434\u0435\u0441\u044c \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043a\u0440\u0430\u0442\u043a\u0443\u044e, \u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0432\u044b\u0436\u0438\u043c\u043a\u0443 \u0438\u0445 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043f\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u043c \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044f\u043c \u0441 2014 \u043f\u043e 2024 \u0433\u043e\u0434\u044b:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">2014<\/p>\n<\/th>\n<th>\n<p align=\"left\">2015<\/p>\n<\/th>\n<th>\n<p align=\"left\">2016<\/p>\n<\/th>\n<th>\n<p align=\"left\">2017<\/p>\n<\/th>\n<th>\n<p align=\"left\">2018<\/p>\n<\/th>\n<th>\n<p align=\"left\">2019<\/p>\n<\/th>\n<th>\n<p align=\"left\">2020<\/p>\n<\/th>\n<th>\n<p align=\"left\">2021<\/p>\n<\/th>\n<th>\n<p align=\"left\">2022<\/p>\n<\/th>\n<th>\n<p align=\"left\">2023<\/p>\n<\/th>\n<th>\n<p align=\"left\">2024<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">7948<\/p>\n<\/td>\n<td>\n<p align=\"left\">6494<\/p>\n<\/td>\n<td>\n<p align=\"left\">6457<\/p>\n<\/td>\n<td>\n<p align=\"left\">14645<\/p>\n<\/td>\n<td>\n<p align=\"left\">16512<\/p>\n<\/td>\n<td>\n<p align=\"left\">17308<\/p>\n<\/td>\n<td>\n<p align=\"left\">18375<\/p>\n<\/td>\n<td>\n<p align=\"left\">20161<\/p>\n<\/td>\n<td>\n<p align=\"left\">25059<\/p>\n<\/td>\n<td>\n<p align=\"left\">28961<\/p>\n<\/td>\n<td>\n<p align=\"left\">40077<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0421 \u043f\u043e\u043b\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u043e\u0439 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u043f\u043e <a href=\"https:\/\/www.cve.org\/About\/Metrics#PublishedCVERecords\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>.<\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0441\u0442\u0451\u0442. \u0418 \u0432 \u0438\u0445 \u043f\u0440\u0435\u0432\u0435\u043d\u0442\u0438\u0432\u043d\u043e\u043c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u043d\u043e\u0435 \u0438 \u0432\u0441\u0435\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u0412\u0435\u0434\u044c \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u044f \u0437\u043e\u043d\u0430 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0432\u0441\u0435, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0443\u0439\u0434\u0451\u0442 \u0432 \u0442\u0435\u043d\u044c.<\/p>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u0432\u0441\u0435\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f <a href=\"https:\/\/en.wikipedia.org\/wiki\/Shift-left_testing\">shift-left<\/a> \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0431\u044b\u043b\u0430 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u043b\u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430, \u0430 \u043d\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u0443\u0436\u0435 \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d\u0435, \u0437\u0430\u0442\u0440\u0430\u0442\u044b \u043d\u0430 \u0435\u0451 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0443\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043c\u0435\u043d\u044c\u0448\u0435. \u0412 \u0441\u0432\u044f\u0437\u0438 \u0441 \u044d\u0442\u0438\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u0432 SAST-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0445 \u043c\u043e\u0436\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0441\u0442\u0438.<\/p>\n<p>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0435\u0441\u044c \u043d\u0430\u0431\u043e\u0440 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b. \u0427\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, Java \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430\u0434 \u0435\u0433\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435\u043c.<\/p>\n<blockquote>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435.<\/strong> \u0420\u0430\u043d\u0435\u0435 \u043c\u044b \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u043b\u0438 \u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e SAST \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430. \u0421\u0440\u0435\u0434\u0438 \u044d\u0442\u043e\u0433\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 (<a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/java\/1198\/\">\u0441\u0442\u0430\u0442\u044c\u044f N1<\/a>, <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/java\/1228\/\">\u0441\u0442\u0430\u0442\u044c\u044f N2<\/a>), <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/java\/1274\/\">\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0435 \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/a> \u043a\u043e\u0434\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u043e\u0442\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/blockquote>\n<p>\u0418 \u043f\u043e \u0438\u0442\u043e\u0433\u0443 \u043d\u0430\u0448 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043c\u043e\u0433 \u043f\u043e\u043a\u0440\u044b\u0442\u044c 9\/10 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 OWASP Top Ten.<\/p>\n<h3>\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 OWASP Top Ten 2021<\/h3>\n<p>\u041e\u043f\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 OWASP Top Ten \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443. \u041c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u0432\u0430\u043c \u043f\u0440\u043e \u0441\u0430\u043c\u0443 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e \u0438 \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u043a\u0430\u0436\u0435\u043c \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 PVS-Studio \u0432\u044b\u0434\u0430\u0451\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0435, \u043a\u0430\u043a \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435.<\/p>\n<h4>A01:2021 \u2014 Broken Access Control<\/h4>\n<p><a href=\"https:\/\/owasp.org\/Top10\/A01_2021-Broken_Access_Control\/\"><strong>Broken Access Control<\/strong><\/a> \u2014 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438, \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0449\u0438\u0435 \u043a \u043d\u0435\u0441\u0430\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0438\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e \u0438\u043b\u0438 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u0438\u044e \u0432\u0441\u0435\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044e \u0431\u0438\u0437\u043d\u0435\u0441-\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u043f\u043e\u043b\u043d\u043e\u043c\u043e\u0447\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"java\">public class RedirectServlet extends HttpServlet {    @Override  protected void doGet(HttpServletRequest request,                        HttpServletResponse response) throws IOException {    String query = request.getQueryString();    if (query.contains(\"url\")) {      String url = request.getParameter(\"url\");      response.sendRedirect(url);               \/\/ &lt;=    }  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0421\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v5324\/\">V5324<\/a> Possible open redirect vulnerability. Potentially tainted data in the &#8216;url&#8217; variable is used in the URL. RedirectServlet.java 15, 14<\/p>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 <code>GET<\/code> \u0437\u0430\u043f\u0440\u043e\u0441, \u0431\u0435\u0440\u0451\u0442 \u0438\u0437 \u043d\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 URL-\u0430\u0434\u0440\u0435\u0441 \u0438 \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043e \u043d\u0435\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0443 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0438\u0448\u0438\u043d\u0433\u043e\u0432\u0443\u044e \u043a\u043e\u043f\u0438\u044e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"java\">https:\/\/notevil.com\/redirect?url=https:\/\/evil.com\/registration<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u0448 \u0441\u0430\u0439\u0442 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0444\u043e\u0440\u043c\u0443 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0430. \u0418 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u0434\u0443\u043c\u0430\u044f, \u0447\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u0434\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435, \u043c\u043e\u0436\u0435\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 \u0441\u0432\u043e\u0438 \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u0410 \u043e\u043d\u0438 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0430\u043f\u0440\u0430\u0432\u044f\u0442\u0441\u044f \u043f\u0440\u044f\u043c\u0438\u043a\u043e\u043c \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0443.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043f\u0435\u0440\u0435\u0434 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443. \u0418 \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u043d\u0435 \u0432 \u0447\u0438\u0441\u043b\u0435 \u0434\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0445 \u2014 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u043e:<\/p>\n<pre><code class=\"java\">private static final List&lt;String&gt; ALLOWED_DOMAINS = List.of(  \"https:\/\/allowed-host1.com\",  \"https:\/\/allowed-host2.com\",  \"https:\/\/allowed-host3.com\");public class RedirectServlet extends HttpServlet {  @Override  protected void doGet(HttpServletRequest request,                        HttpServletResponse response) throws IOException {    String query = request.getQueryString();    if (query.contains(\"url\")) {      String url = request.getParameter(\"url\");      if (ALLOWED_DOMAINS.contains(url)) {      \/\/ &lt;=        response.sendRedirect(url);                    } else {        \/\/....      }    }  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u042d\u0442\u043e \u043b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0437\u0430\u0449\u0438\u0442\u044b. C \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0448\u0438\u0440\u043d\u044b\u043c \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0443\u0431\u0440\u0438\u043a\u0435 <a href=\"https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html\">Cheat Sheet<\/a> \u0432 \u0431\u043b\u043e\u0433\u0435 OWASP. \u0412 \u043d\u0435\u0439 \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438 \u043f\u043e \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"java\">private final Path uploadDir = Path.of(\"\/var\/www\/uploads\");@Overridepublic void init() throws ServletException {  try {    Files.createDirectories(uploadDir);    Files.setPosixFilePermissions(            uploadDir,            PosixFilePermissions.fromString(\"rwxrwxrwx\"));  \/\/ &lt;=  } catch (IOException e) {      throw new ServletException(e);  }}@Overrideprotected void doPost(HttpServletRequest req,                      HttpServletResponse resp) throws .... {  Part filePart = req.getPart(\"file\");  Path target = uploadDir.resolve(Paths.get(filePart.getSubmittedFileName()));  try (InputStream in = filePart.getInputStream()) {    Files.copy(in, target, StandardCopyOption.REPLACE_EXISTING);  }  resp.getWriter().println(\"uploaded to \" + target);}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0421\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v5318\/\">V5318<\/a> Setting loose POSIX file permissions (rwxrwxrwx) is security-sensitive. PermissionsExample.java 13<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f \u0444\u0430\u0439\u043b\u044b, \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0430 \u0433\u0440\u0443\u043f\u043f\u0435 OTHERS. \u0412 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430. \u0418 \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, <code>shell.jsp<\/code>), \u0442\u043e \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a \u043d\u0435\u043c\u0443 \u043e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f (\u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 Tomcat \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c):<\/p>\n<pre><code class=\"java\">https:\/\/example.com\/uploads\/shell.jsp<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u0430\u043a, \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0434\u043b\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0432\u0435\u043b\u0430 \u043a RCE (\u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430). \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439 \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u043e, \u0432\u0430\u0436\u043d\u043e \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0439. \u0410 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0432\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u043f\u0440\u043e\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b.<\/p>\n<h4>A02:2021 \u2014 Cryptographic Failures<\/h4>\n<p>\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f <a href=\"https:\/\/owasp.org\/Top10\/A02_2021-Cryptographic_Failures\/\"><strong>Cryptographic Failures<\/strong><\/a> \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0433\u0440\u0443\u043f\u043f\u0443 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0438\u043b\u0438 \u0445\u0435\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 \u043d\u0435\u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u0438 \u0442.\u0434.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"java\">public static void callExternalApi() throws Exception {  SSLContext sslContext = SSLContext.getInstance(\"TLSv1\");     \/\/ &lt;=  sslContext.init(null, null, new java.security.SecureRandom());  HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());  URL url = new URL(\"https:\/\/external-api.example.com\/data\");    HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();  try (BufferedReader in = new BufferedReader(          new InputStreamReader(conn.getInputStream()))  ) {    String inputLine;    while ((inputLine = in.readLine()) != null)      System.out.println(inputLine);  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0421\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v5313\/\">V5313<\/a> Do not use old versions of SSL\/TLS protocols as it may cause security issues. Insecure protocols: TLSv1. SSLExample.java 11<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 SSL\/TLS. \u0422\u0430\u043a\u0430\u044f \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u0430 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0442\u0430\u043a\u0438\u043c \u0430\u0442\u0430\u043a\u0430\u043c, \u043a\u0430\u043a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Man-in-the-middle_attack\">Man-In-The-Middle<\/a>, \u0435\u0451 \u043f\u043e\u0434\u0432\u0438\u0434\u0443 \u2014 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Transport_Layer_Security#BEAST_attack\">BEAST<\/a>, \u0438 \u0442.\u0434. \u0415\u0441\u043b\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0435\u0435, \u0442\u043e \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u043e\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 \u0438 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430\/\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u0430\u043c\u0438.<\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0438\u0442\u044c \u0441\u0435\u0431\u044f, \u043b\u0443\u0447\u0448\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u043d\u043e\u0432\u043e\u0439 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u044d\u0442\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u2014 &#171;TLSv1.2&#187; \u0438\u043b\u0438 &#171;TLSv1.3&#187;.<\/p>\n<p>\u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0441\u043b\u0435\u0434\u0438\u0435\u043c legacy-\u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0438, \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c SAST-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u2014 \u043b\u0443\u0447\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e.<\/p>\n<h4>A03:2021 \u2014 Injection<\/h4>\n<p><a href=\"https:\/\/owasp.org\/Top10\/A03_2021-Injection\/\"><strong>Injection<\/strong><\/a> \u2014 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0437\u0430 \u0441\u0447\u0451\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0435\u043d\u0430\u0434\u0451\u0436\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0438 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0435\u0441\u0442\u0430 (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u0430) \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0432\u0435\u0441\u0442\u0438 \u0441\u0435\u0431\u044f \u043d\u0435 \u0442\u0430\u043a, \u043a\u0430\u043a \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e. \u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u043f\u043e\u0440\u0447\u0430 \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0445 \u043e\u0431\u043d\u0430\u0440\u043e\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043b\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<p>\u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a \u0443 \u043d\u0430\u0441 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. \u041f\u043e\u043a\u0430\u0436\u0443 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u0430\u043c\u043e\u0439 \u0442\u0438\u043f\u043e\u0432\u043e\u0439 \u2014 SQL-\u0438\u043d\u044a\u0435\u043a\u0446\u0438\u0438. \u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0438 \u0441\u043e\u0431\u043e\u0439 \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u043d\u043e\u043c \u043a \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u2014 \u043f\u0440\u043e\u0441\u0442\u043e\u043c MVC-\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435. \u0417\u0430\u043e\u0434\u043d\u043e \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0441\u043c\u043e\u0436\u0435\u0442 \u043b\u0438 PVS-Studio \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u0431\u043e\u043b\u044c\u0448\u0435 \u0438 \u043f\u043e\u0441\u043b\u043e\u0436\u043d\u0435\u0435.<\/p>\n<p>DemoController.java:<\/p>\n<pre><code class=\"java\">@RestControllerpublic class DemoController {  @Autowired  private DemoService service;  @RequestMapping(\"demo\")  public ResponseEntity&lt;DemoObject&gt;             demoEndpoint(@RequestParam(name=\"name\") String name  ) {    return service.findByName(name)                  .map(ResponseEntity::ok)                  .orElse(ResponseEntity.notFound().build());  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u043f\u0440\u043e\u0441, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>name<\/code> \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0432 <code>DemoService<\/code>.<\/p>\n<p>DemoService.java:<\/p>\n<pre><code class=\"java\">@Servicepublic class DemoService {  @Autowired  DemoRepository demoRepository;  Optional&lt;DemoObject&gt; findByName(String name) {    return demoRepository.findByName(name);  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><code>DemoService<\/code> \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044e <code>DemoRepository<\/code>, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u0435\u043c\u0443 \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0438\u0439 <code>name<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430.<\/p>\n<p>DemoRepository.java:<\/p>\n<pre><code class=\"java\">@Repositorypublic class DemoRepository {  @Autowired  private JdbcTemplate jdbcTemplate;  Optional&lt;DemoObject&gt; findByName(String name) {    var sql = \"SELECT * FROM demoTable WHERE name = '\" + name + \"'\";    if (name.equals(\"demoCondition\")) {      sql = \"SELECT * FROM demoTable WHERE name = demoName\";      return Optional.ofNullable(              jdbcTemplate.queryForObject(sql, DemoObject.class));    }    return Optional.ofNullable(            jdbcTemplate.queryForObject(sql, DemoObject.class));  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043c\u044b \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c SQL-\u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio \u0432\u044b\u0434\u0430\u0451\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v5309\/\">V5309<\/a> Possible SQL injection. Potentially tainted data in the &#8216;sql&#8217; variable is used to create SQL command. DemoRepository.java 23, DemoController.java 16<\/p>\n<p>\u0421\u0430\u043c\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0437\u0430\u0433\u0432\u043e\u0437\u0434\u043a\u043e\u0439 \u0432\u0441\u0435\u0439 \u044d\u0442\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438. \u041f\u043e\u043a\u0430\u0436\u0443 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u0435\u0435:<\/p>\n<pre><code class=\"java\">var sql = \"SELECT * FROM demoTable WHERE name = '\" + name + \"'\";<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0417\u0430\u043f\u0440\u043e\u0441 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u043a\u0430\u0442\u0435\u043d\u0430\u0446\u0438\u044e. \u0418 \u0435\u0441\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0443 <code>name<\/code> \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c:<\/p>\n<pre><code class=\"java\">' or 1==1; drop table demoTable; --<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u0430 <code>demoTable<\/code> \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u0430.<\/p>\n<p>\u041f\u043e \u043f\u0443\u0442\u0438 \u043e\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0434\u043e \u0441\u0430\u043c\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043e\u0447\u0438\u0441\u0442\u0438\u043b\u0438 \u0438 \u043d\u0435 \u0441\u0430\u043d\u0438\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438. \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u044d\u0442\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0438 \u0432\u044b\u0434\u0430\u043b \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435. \u0427\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0438\u0442\u044c \u0441\u0432\u043e\u0451 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0434 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043b\u0438\u0431\u043e \u043e\u0447\u0438\u0449\u0430\u0442\u044c, \u043b\u0438\u0431\u043e \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u0449\u0438\u0442\u044b \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 SQL-\u0438\u043d\u044a\u0435\u043a\u0446\u0438\u0438 \u2014 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b:<\/p>\n<pre><code class=\"java\">Optional&lt;DemoObject&gt; findByName(String name) {  String sql;  if (\"demoCondition\".equals(name)) {    sql = \"SELECT * FROM demoTable WHERE name = demoName\";    return Optional.ofNullable(      jdbcTemplate.queryForObject(        sql,        new BeanPropertyRowMapper&lt;&gt;(DemoObject.class)      )    );  }  sql = \"SELECT * FROM demoTable WHERE name = ?\";  return Optional.ofNullable(    jdbcTemplate.queryForObject(      sql,      new BeanPropertyRowMapper&lt;&gt;(DemoObject.class),      name    )  );}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>A04:2021 \u2014 Insecure Design<\/h4>\n<p><a href=\"https:\/\/owasp.org\/Top10\/A04_2021-Insecure_Design\/\"><strong>Insecure Design<\/strong><\/a> \u2014 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0448\u0438\u0440\u043e\u043a\u0430\u044f \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0449\u0430\u044f \u0432 \u0441\u0435\u0431\u0435 \u0433\u0440\u0443\u043f\u043f\u0443 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0432\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0433\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041e\u0434\u043d\u0443 \u0438\u0437 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439 \u043c\u044b \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438, \u043a\u043e\u0433\u0434\u0430 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u0432\u0430\u043c \u043f\u0440\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e A01. \u041a \u044d\u0442\u043e\u0439 \u0436\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0448\u0438\u0440\u043e\u043a\u0438\u0445 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0433\u0440\u0443\u043f\u043f\u0435 OTHERS \u0438 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430 <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v5318\/\">V5318<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442. \u041d\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u044b \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u0435\u0449\u0451 \u043e\u0434\u0438\u043d:<\/p>\n<pre><code class=\"java\">@Overrideprotected void doGet(HttpServletRequest req,                     HttpServletResponse res) throws IOException {  String requestedSessionId = req.getRequestedSessionId();  if (requestedSessionId != null &amp;&amp; requestedSessionId.startsWith(\"ADMIN-\")) {    \/\/ ....  }  \/\/....}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0421\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v5316\/\">V5316<\/a> The use of HttpServletRequest#getRequestedSessionId is discouraged as it may expose security risks. DemoServlet.java 15<\/p>\n<p>\u042d\u0442\u0430 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <a href=\"https:\/\/cwe.mitre.org\/data\/definitions\/807.html\">CWE-807<\/a>: \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432 security-\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<details class=\"spoiler\">\n<summary>CWE?<\/summary>\n<div class=\"spoiler__content\">\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/terms\/6476\/\">CWE<\/a> (Common Weakness Enumeration) \u2014 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u0430\u044f \u0438 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u043c\u0430\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f CWE \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 OWASP Top Ten, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043d\u0430\u0441 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u043c \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u044b\u0445 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a. \u0418 \u0443 \u043d\u0430\u0441 <a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/sast\/cwe\/\">\u043d\u0430 \u0441\u0430\u0439\u0442\u0435<\/a> \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a \u043d\u0430\u0448\u0438 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 \u0441\u043e\u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u0441\u043e CWE \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430\u043c\u0438.<\/p>\n<\/div>\n<\/details>\n<p>\u041c\u0435\u0442\u043e\u0434 <code>getRequestSessionId<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u043e\u0442 ID \u0441\u0435\u0441\u0441\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0434\u0430\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u0430 \u043d\u0435 \u0442\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442.<\/p>\n<p>\u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0432\u0432\u043e\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u0440\u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e. \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 ID \u0441\u0435\u0441\u0441\u0438\u0438. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u043c:<\/p>\n<pre><code class=\"java\">request.getSession().getId();<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>A05:2021 \u2014 Security Misconfiguration<\/h4>\n<p><a href=\"https:\/\/owasp.org\/Top10\/A05_2021-Security_Misconfiguration\/\"><strong>Security Misconfiguration<\/strong><\/a> \u2014 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439: \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043b\u0438\u0448\u043d\u0438\u0445 \u043f\u043e\u0440\u0442\u043e\u0432 \u0438\u043b\u0438 \u0441\u043b\u0443\u0436\u0431, \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437\u0432\u043d\u0435 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0438 \u0442.\u0434.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"java\">public class MisconfigurationExample extends HttpServlet {  @Override  protected void doPost(HttpServletRequest req,                        HttpServletResponse resp) throws IOException {    String key = req.getParameter(\"key\");    String value = req.getParameter(\"value\");    if (key == null || value == null || key.isBlank()) {      resp.sendError(400, \"Invalid key or value\");      return;    }    System.setProperty(key, value);    resp.setContentType(\"text\/plain\");    \/\/....  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0421\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v5320\/\">V5320<\/a> Potentially tainted data in the &#8216;value&#8217; variable is used in configuration settings. This may cause security issues. MisconfigurationExample.java 22<\/p>\n<p>\u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430. \u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0438\u0437\u0432\u043d\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443:<\/p>\n<ul>\n<li>\n<p>\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0443\u0442\u0435\u0447\u043a\u0435 \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u0435\u0451 \u043f\u043e\u0440\u0447\u0435. \u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u2014 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u043e\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0430\u0434\u0440\u0435\u0441 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0438\u043c\u0435\u043d\u0438 \u0411\u0414 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c, \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u043e\u0441\u044c;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043f\u0430\u0434\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438\u043b\u0438 \u0435\u0451 \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c, \u0442\u0440\u0443\u0434\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u0433\u0434\u0435 \u044d\u0442\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0447\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0451\u0442. \u041d\u043e, \u0435\u0441\u043b\u0438 \u0432\u0441\u0451 \u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437\u0432\u043d\u0435 \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432, \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 &#171;\u0431\u0435\u043b\u043e\u0433\u043e \u043b\u0438\u0441\u0442\u0430&#187;:<\/p>\n<pre><code class=\"java\">private static final List&lt;String&gt; ALLOWED_VALUES = List.of(        \"value1\",        \"value2\",        \"value3\");@Overrideprotected void doPost(HttpServletRequest req,                      HttpServletResponse resp) throws IOException {  \/\/....  if (    key == null || value == null || key.isBlank()      || !ALLOWED_VALUES.contains(value)  ) {    resp.sendError(400, \"Invalid key or value\");    return;  }  \/\/....}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>\u041006:2021 \u2014 Vulnerable and Outdated Components<\/h4>\n<p>\u0412\u044b\u0448\u0435 \u044f \u0433\u043e\u0432\u043e\u0440\u0438\u043b, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 \u043d\u0430 9 \u0438\u0437 10 Top Ten \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439. \u0418 \u043f\u043e\u043a\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0430 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u0439 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439, \u0447\u0442\u043e \u043d\u0430\u043c\u0438 \u043d\u0435 \u043f\u043e\u043a\u0440\u044b\u0442\u0430.<\/p>\n<p><a href=\"https:\/\/owasp.org\/Top10\/A06_2021-Vulnerable_and_Outdated_Components\/\"><strong>Vulnerable and Outdated Components<\/strong><\/a> \u2014 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u0443 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u0443\u044e \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438\u043b\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0432\u0435\u0440\u0441\u0438\u0438, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0439 \u0432 \u0441\u0435\u0431\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043d\u0443\u044e \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c.<\/p>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u043d\u0430\u0441 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043a\u0430\u043a \u043b\u0443\u0447\u0448\u0435 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u0443\u044f\u0437\u0432\u0438\u043c\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f, \u043c\u044b \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c. \u0422\u0430\u043a \u0447\u0442\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043b\u0435\u0434\u0438\u0442\u0435 \u0437\u0430 \u043d\u0430\u0448\u0438\u043c\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u043d\u043e\u0432\u044b\u043c\u0438 <a href=\"https:\/\/pvs-studio.ru\/ru\/whatsnew\/\">\u0440\u0435\u043b\u0438\u0437\u0430\u043c\u0438<\/a>. \u0418 \u0432 \u0431\u043b\u043e\u0433\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c.<\/p>\n<h4>A07:2021 \u2014 Identification and Authentication Failures<\/h4>\n<p><a href=\"https:\/\/owasp.org\/Top10\/A07_2021-Identification_and_Authentication_Failures\/\"><strong>Identification and Authentication failures<\/strong><\/a> \u2014 \u0433\u0440\u0443\u043f\u043f\u0430 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0441\u0435\u0430\u043d\u0441\u0430\u043c\u0438 \u0438\u043b\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u041e\u0431\u044b\u0447\u043d\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0435\u0442\u0430\u0446\u0438\u0438 \u043f\u0430\u0440\u043e\u043b\u0435\u0439, \u043a\u043b\u044e\u0447\u0435\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0438\u043b\u0438 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0441\u0435\u0430\u043d\u0441\u0430, \u0438\u043b\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0443 \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"java\">@Configurationpublic class CorsConfig {  @Bean  public WebMvcConfigurer corsConfigurer() {    return new WebMvcConfigurer() {      @Override      public void addCorsMappings(CorsRegistry registry) {        registry.addMapping(\"\/**\")                .allowedOrigins(\"*\")          \/\/ &lt;=                .allowedMethods(\"*\")                .allowCredentials(true);      }    };  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0421\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v5325\/\">V5325<\/a> Setting the value of the &#8216;Access-Control-Allow-Origin&#8217; header to &#8216;*&#8217; is potentially insecure. CorsConfig.java 16<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f CORS. \u0412\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>*<\/code> \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0443 <code>Access-Control-Allow-Origin<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0445\u043e\u0441\u0442\u0443 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043b\u044e\u0431\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043e\u0442\u0432\u0435\u0442\u0430 \u043a\u0440\u043e\u0441\u0441-\u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0441\u043e\u0432\u0435\u0440\u0448\u0451\u043d\u043d\u044b\u0445 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435\u0439. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e \u044d\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c, \u043f\u0435\u0440\u0435\u0439\u0434\u044f <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/terms\/7005\/\">\u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/a>. \u0417\u0434\u0435\u0441\u044c \u043b\u0438\u0448\u044c \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438:<\/p>\n<ul>\n<li>\n<p>\u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0438\u0435 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e;<\/p>\n<\/li>\n<li>\n<p>\u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c API \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0437\u0430 \u0441\u0432\u043e\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u0430\u0442\u0430\u043a\u0443\u0435\u043c\u043e\u0439 \u0436\u0435\u0440\u0442\u0432\u044b (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, cookies);<\/p>\n<\/li>\n<li>\n<p>\u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0441\u0430\u0439\u0442 \u043f\u043e\u0434\u0432\u0435\u0440\u0436\u0435\u043d <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/terms\/6462\/\">XSS<\/a>, \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f \u0430\u0442\u0430\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u044b\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418 \u0440\u0430\u0437 \u0443\u0436 \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u043b\u0438 \u0442\u0435\u043c\u0443 CORS, \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0438\u0437 \u044d\u0442\u043e\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438:<\/p>\n<pre><code class=\"java\">public class NaiveCorsFilter implements Filter {  @Override  public void doFilter(ServletRequest request,                        ServletResponse response,                       FilterChain chain) throws .... {    HttpServletRequest req  = (HttpServletRequest) request;    HttpServletResponse res = (HttpServletResponse) response;    String origin = req.getParameter(\"origin\");    res.setHeader(\"Access-Control-Allow-Origin\",                   origin);    res.setHeader(\"Access-Control-Allow-Credentials\",                   \"true\");    res.setHeader(\"Access-Control-Allow-Methods\",                   \"GET,POST,PUT,DELETE\");    res.setHeader(\"Access-Control-Allow-Headers\",                   \"Content-Type,Authorization\");    chain.doFilter(request, response);  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0421\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v5323\/\">V5323<\/a> Potentially tainted data in the &#8216;origin&#8217; variable is used to define the &#8216;Access-Control-Allow-Origin&#8217; header. NaiveCorsFilter.java 25, 22<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c CORS-\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0438\u0445 \u0438\u0437\u0432\u043d\u0435. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f \u0442\u0430\u043a\u0438\u0435 \u0436\u0435, \u043a\u0430\u043a \u0438 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435. \u0418 \u0432 \u043e\u0431\u0435\u0438\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445 \u043b\u0443\u0447\u0448\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043e\u0434\u043d\u043e\u043c\u0443 \u0438\u0437 \u0440\u0430\u0437\u0440\u0435\u0448\u0451\u043d\u043d\u044b\u0445 \u0434\u043e\u043c\u0435\u043d\u043e\u0432:<\/p>\n<pre><code class=\"java\">private static final List&lt;String&gt; ALLOWED_HOSTS = List.of(  \"https:\/\/allowed-host1.com\",  \"https:\/\/allowed-host2.com\",  \"https:\/\/allowed-host3.com\");@Overridepublic void doFilter(ServletRequest request,                      ServletResponse response,                     FilterChain chain) throws .... {  HttpServletRequest req  = (HttpServletRequest) request;  HttpServletResponse res = (HttpServletResponse) response;    String origin = req.getParameter(\"origin\");  if (ALLOWED_HOSTS.contains(origin)) {    res.setHeader(\"Access-Control-Allow-Origin\",                   origin);  } else {    res.setHeader(\"Access-Control-Allow-Origin\",                   ALLOWED_HOSTS.getFirst());  }  ....}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>A08:2021 \u2014 Software and Data Integrity Failures<\/h4>\n<p><a href=\"https:\/\/owasp.org\/Top10\/A08_2021-Software_and_Data_Integrity_Failures\/\"><strong>Software and Data Integrity Failures<\/strong><\/a> \u2014 \u0433\u0440\u0443\u043f\u043f\u0430 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0449\u0438\u0445 \u043a \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u044e \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f. \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u043f\u043e\u0434\u043f\u0438\u0441\u0438, \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0430\u044f \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438\u0437 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0445 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432 \u0438 \u0442.\u0434.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"java\">public class UnsafeDeserializeServlet extends HttpServlet {  @Override  protected void doPost(HttpServletRequest req,                        HttpServletResponse res) throws .... {    try (InputStream in = req.getInputStream();         ObjectInputStream ois = new ObjectInputStream(in)   \/\/ &lt;=    ) {      Object obj = ois.readObject();             \/\/ ....    } catch (ClassNotFoundException e) {      throw new ServletException(\"Unknown class during deserialization\", e);    }  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0421\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v5333\/\">V5333<\/a> Possible insecure deserialization vulnerability. Potentially tainted data in the &#8216;in&#8217; variable is used to deserialize an object. UnsafeDeserializeServlet.java 19, 18<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u041f\u043e\u0442\u043e\u043a \u0431\u0430\u0439\u0442\u043e\u0432 \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442. \u041d\u0438 \u0447\u0442\u043e \u044d\u0442\u043e \u0437\u0430 \u043e\u0431\u044a\u0435\u043a\u0442, \u043d\u0438 \u0440\u0430\u0437\u0440\u0435\u0448\u0451\u043d \u043b\u0438 \u043e\u043d \u0434\u043b\u044f \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u042d\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0434\u043b\u044f <a href=\"https:\/\/encyclopedia.kaspersky.ru\/glossary\/remote-code-execution-rce\/\">RCE<\/a>-\u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0414\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0447\u0435\u0440\u0435\u0437 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 Java-\u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u043d\u0435 \u043b\u0443\u0447\u0448\u0430\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0432\u0441\u0451 \u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u043e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0438\u0442\u044c \u0441\u0435\u0431\u044f \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u0430\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0438 \u0435\u0441\u0442\u044c \u043b\u0438 \u043e\u043d \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0442\u0435\u0445, \u0447\u0442\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c:<\/p>\n<pre><code class=\"java\">class AllowedClass1 { }class AllowedClass2 { }class SecureObjectInputStream extends ObjectInputStream {  List&lt;String&gt; allowedClasses = List.of(    AllowedClass1.class.getName(),    AllowedClass2.class.getName()  );    public SecureObjectInputStream(InputStream in) throws .... {    super(in);  }    @Override  protected Class&lt;?&gt; resolveClass(ObjectStreamClass osc) throws .... {    if (!allowedClasses.contains(osc.getName())) {      throw new InvalidClassException(\"Unauthorized deserialization\",                                       osc.getName());    }    return super.resolveClass(osc);  }}public class DeserializeServlet extends HttpServlet {  @Override  protected void doPost(HttpServletRequest req,                        HttpServletResponse res) .... {    try (InputStream in = req.getInputStream();         ObjectInputStream ois = new SecureObjectInputStream(in)    ) {      Object obj = ois.readObject();      \/\/ ....    } catch (ClassNotFoundException e) {      throw new ServletException(\"Unknown class during deserialization\", e);    }  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>A09:2021 \u2014 Security Logging and Monitoring Failures<\/h4>\n<p><a href=\"https:\/\/owasp.org\/Top10\/A09_2021-Security_Logging_and_Monitoring_Failures\/\"><strong>Security Logging and Monitoring Failures<\/strong><\/a> \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0432\u0441\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442:<\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u043c\u0435\u0448\u0430\u0442\u044c \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0438\u0437-\u0437\u0430 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0438\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438\u0437 \u043b\u043e\u0433\u043e\u0432 \u0442\u0440\u0435\u0442\u044c\u0438\u043c \u043b\u0438\u0446\u0430\u043c;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0438\u043d\u044a\u0435\u043a\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"java\">public class AccessLogFilter extends OncePerRequestFilter {  private static final Logger                        log = LoggerFactory.getLogger(AccessLogFilter.class);  @Override  protected void doFilterInternal(HttpServletRequest request,                                  HttpServletResponse response,                                  FilterChain filterChain) throws .... {    String ip     = request.getRemoteAddr();    String method = request.getMethod();    String uri    = request.getRequestURI();    String qs     = request.getQueryString();    log.info(\"Access {} {}{}?{} from {}\",              method, uri, \"?\",              qs,   \/\/ &lt;=              ip);    filterChain.doFilter(request, response);  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0421\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v5319\/\">V5319<\/a> Possible log injection. Potentially tainted data in the &#8216;qs&#8217; variable is written into logs. AccessLogFilter.java 33, 29<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0437\u0430\u0441\u043e\u0440\u044f\u0442\u044c \u043b\u043e\u0433\u0438 \u0438 \u0432\u043d\u0435\u0434\u0440\u044f\u0442\u044c \u0432 \u043d\u0438\u0445 \u043b\u043e\u0436\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u0421\u0430\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 URL-\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 <code>\\n<\/code>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 URL-\u0437\u0430\u043f\u0440\u043e\u0441 \u0431\u044b\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c:<\/p>\n<pre><code class=\"java\">\/products?category=books%0AERROR:+Inventory+breach+detected<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u043e \u0441\u0442\u0440\u043e\u043a\u0430 <code>qs<\/code> \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443:<\/p>\n<pre><code class=\"java\">category=books\\nERROR: Inventory breach detected<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043b\u043e\u0433\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"java\">INFO  Access GET \/products?category=books from 10.1.1.5ERROR: Inventory breach detected<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043b\u043e\u0433\u0433\u0435\u0440\u043e\u043c. \u041f\u0440\u0438 \u0446\u0435\u043b\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0430\u0442\u0430\u043a\u0435 \u0442\u0430\u043a\u0438\u0445 \u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u043d\u043e\u0433\u043e. \u0418 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0438\u0437-\u0437\u0430 \u043e\u0431\u0438\u043b\u0438\u044f \u043b\u043e\u0436\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0435\u0451 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u044b\u043c.<\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0438\u0437\u0432\u043d\u0435 \u0438 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u043b\u043e\u0433\u0438. \u041e\u0447\u0438\u0441\u0442\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e, \u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0433\u043e\u0442\u043e\u0432\u044b\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u044b\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 <a href=\"https:\/\/commons.apache.org\/proper\/commons-text\/apidocs\/org\/apache\/commons\/text\/StringEscapeUtils.html\"><code>org.apache.commons.text.StringEscapeUtils<\/code><\/a>.<\/p>\n<h4>A10:2021 \u2014 Server-Side Request Forgery (SSRF)<\/h4>\n<p><a href=\"https:\/\/owasp.org\/Top10\/A10_2021-Server-Side_Request_Forgery_%28SSRF%29\/\"><strong>Server-Side Request Forgery<\/strong><\/a> (<strong>SSRF<\/strong>) \u2014 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u0440\u0435\u0441\u0443\u0440\u0441\u0443 \u0431\u0435\u0437 \u0435\u0433\u043e \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u0426\u0435\u043b\u0438 \u0443 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u0430\u0442\u0430\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>\u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0430\u0442\u0430\u043a\u0443\u0435\u043c\u043e\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0438\u043b\u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>\u043a\u0440\u0430\u0436\u0430 \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445;<\/p>\n<\/li>\n<li>\n<p>\u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0440\u0435\u0434\u043e\u043d\u043e\u0441\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u0430\u0442\u0430\u043a\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"java\">@RestControllerpublic class PreviewController {  @GetMapping(\"\/fetch\")  public String fetchUrl(@RequestParam(\"url\") String url) throws Exception {    URL external = new URL(url);    HttpURLConnection conn = (HttpURLConnection) external.openConnection();    conn.setConnectTimeout(2000);    conn.setReadTimeout(2000);    BufferedReader br = new BufferedReader(new InputStreamReader(                                               conn.getInputStream()                                           ));    StringBuilder sb = new StringBuilder();    String line;    while ((line = br.readLine()) != null) {      sb.append(line).append('\\n');    }    br.close();    return sb.toString();  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0421\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v5334\/\">V5334<\/a> Possible server-side request forgery. Potentially tainted data in the &#8216;external&#8217; variable is used to access a remote resource. PreviewController.java 17, 15<\/p>\n<p>\u0418\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c URL, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u0435\u0437 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u0440\u0430\u0437\u0443 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u0417\u0434\u0435\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u0435\u0441\u043b\u0438 \u0430\u0434\u0440\u0435\u0441 \u0431\u0443\u0434\u0435\u0442, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c: <code>http:\/\/127.0.0.1:8080\/admin<\/code>.<\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b, \u0433\u0434\u0435 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0446\u0435\u043b\u044f\u043c\u0438. \u041e\u0431\u0449\u0438\u043c \u0434\u043b\u044f \u043d\u0438\u0445 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0437\u0430\u0449\u0438\u0442\u044b \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0435\u0433\u043e \u0438\u0437\u0432\u043d\u0435 \u0430\u0434\u0440\u0435\u0441\u0430:<\/p>\n<pre><code class=\"java\">private static final List&lt;String&gt; ALLOWED_URLS = List.of(  \"https:\/\/allowed-domain1.com\",  \"https:\/\/allowed-domain2.com\");@GetMapping(\"\/fetch\")public String fetchUrl(@RequestParam(\"url\") String url) throws Exception {  if (!ALLOWED_URLS.contains(url)) {    \/\/....    return \"Invalid url\";  }  ....}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h3>\u0418\u0442\u043e\u0433<\/h3>\n<p>\u041c\u044b \u043a\u0440\u0430\u0442\u043a\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438, \u0447\u0442\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 OWASP Top Ten \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445. \u0418 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0441 \u044d\u0442\u0438\u043c \u043e\u0434\u043d\u0438\u043c \u0433\u043b\u0430\u0437\u043a\u043e\u043c \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u043b\u0438 \u043d\u0430 SAST \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0448\u0435\u0433\u043e Java \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>\u0411\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e, \u0440\u0430\u0431\u043e\u0442\u0430 \u043d\u0430\u0434 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442\u0441\u044f, \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\/\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442\u0441\u044f \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0440\u0435\u043b\u0438\u0437\u043e\u043c. \u041b\u0443\u0447\u0448\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u2014 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/try-free\/?utm_source=website&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=1287\">\u0441\u0430\u043c\u043e\u043c\u0443<\/a>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043c\u044b\u0441\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f, \u0434\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438. \u0421 \u0440\u0430\u0434\u043e\u0441\u0442\u044c\u044e \u0441 \u0432\u0430\u043c\u0438 \u043f\u043e\u043e\u0431\u0449\u0430\u0435\u043c\u0441\u044f.<\/p>\n<p>\u0410 \u043d\u0430 \u044d\u0442\u043e\u043c \u0443 \u043d\u0430\u0441 \u0432\u0441\u0451. \u0421\u043b\u0435\u0434\u0438\u0442\u0435 \u0437\u0430 \u043d\u0430\u0448\u0438\u043c \u0431\u043b\u043e\u0433\u043e\u043c, \u0438 \u0434\u043e \u0441\u043a\u043e\u0440\u044b\u0445 \u0432\u0441\u0442\u0440\u0435\u0447.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0441 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0435\u0439, \u0442\u043e \u043f\u0440\u043e\u0448\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434: Vladislav Bogdanov. <a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/java\/1287\/\">OWASP Top Ten 2021 explained with simple Java examples and SAST insights<\/a>.<\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/947332\/\">https:\/\/habr.com\/ru\/articles\/947332\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u043f\u0440\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 OWASP Top Ten 2021 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u0438\u0437\u043c\u0443 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439 Java \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 PVS-Studio. \u0422\u0430\u043a \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 Java \u043a\u043e\u0434\u0435 \u0438\u043b\u0438 \u0443\u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 OWASP Top Ten, \u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0433\u043e \u0447\u0442\u0435\u043d\u0438\u044f!\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u041c\u044b \u2014 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f PVS-Studio, \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u043e\u0434\u043d\u043e\u0438\u043c\u0451\u043d\u043d\u044b\u0439 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0443\u0436\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 18 \u043b\u0435\u0442. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u044f\u0437\u044b\u043a\u0430\u043c\u0438 C\/C++, C# \u0438 Java. \u0421 \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0437\u0430\u043d\u044f\u043b\u0438\u0441\u044c \u0442\u0435\u043c, \u0447\u0442\u043e\u0431\u044b Java \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043c\u043e\u0433 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f SAST-\u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c. \u0412\u0435\u0434\u044c Java \u2014 \u043e\u0434\u0438\u043d \u0438\u0437 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0435\u0439\u0448\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.SAST?SAST (Static Application Security Testing) \u2014 \u044d\u0442\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u043f\u043e\u0438\u0441\u043a\u0435 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0435\u0433\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0422.\u0435. \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437, \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u043f\u043e\u0438\u0441\u043a \u043e\u0448\u0438\u0431\u043e\u043a \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u041f\u041e \u0435\u0449\u0451 \u0434\u043e \u0435\u0433\u043e \u0432\u044b\u0445\u043e\u0434\u0430 \u0432 \u0440\u0435\u043b\u0438\u0437. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0437\u0434\u0435\u0441\u044c.\u0418 \u043d\u0430\u0441 \u0447\u0430\u0441\u0442\u043e \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044e\u0442: &#171;\u041a\u0430\u043a \u0432\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0435 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440? \u0427\u0435\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0443\u0435\u0442\u0435\u0441\u044c?&#187; \u0412 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 SAST-\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 Java \u0434\u043b\u044f \u043d\u0430\u0441 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f OWASP Top Ten.OWASP Top Ten \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 OWASP, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043e\u0431\u043e\u0439 \u0440\u0435\u0439\u0442\u0438\u043d\u0433 \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 web-\u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u043d \u0440\u0430\u0437 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u0442\u0447\u0451\u0442\u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u0432 \u0438 \u043a\u043e\u043d\u0441\u0443\u043b\u044c\u0442\u0430\u043d\u0442\u043e\u0432 \u043f\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, bug bounty \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 \u0438 \u0441\u0430\u043c\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 web-\u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a, \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a 2021 \u0433\u043e\u0434\u0443. \u041e\u0434\u043d\u0430\u043a\u043e \u0437\u0434\u0435\u0441\u044c \u0445\u043e\u0447\u0443 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0439\u0442\u0438 OWASP Top Ten 2025. \u0412 \u043d\u0430\u0448\u0435\u043c \u0431\u043b\u043e\u0433\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0437\u043e\u0440, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u0438 \u0441\u043b\u0435\u0434\u0438\u0442\u0435.\u0410 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e SAST \u0438 OWASP Top Ten \u0432\u0430\u0436\u043d\u044b \u0438 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b? \u0421 \u043a\u0430\u0436\u0434\u044b\u043c \u0433\u043e\u0434\u043e\u043c \u0440\u043e\u0441\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0441\u0442\u0451\u0442. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0435 \u043e\u0442 CVE.CVE?CVE (Common Vulnerabilities and Exposures) \u2014 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u0449\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u043c\u043e\u0436\u043d\u043e \u0437\u0434\u0435\u0441\u044c.\u0417\u0434\u0435\u0441\u044c \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043a\u0440\u0430\u0442\u043a\u0443\u044e, \u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0432\u044b\u0436\u0438\u043c\u043a\u0443 \u0438\u0445 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043f\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u043c \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044f\u043c \u0441 2014 \u043f\u043e 2024 \u0433\u043e\u0434\u044b:201420152016201720182019202020212022202320247948649464571464516512173081837520161250592896140077\u0421 \u043f\u043e\u043b\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u043e\u0439 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435.\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0441\u0442\u0451\u0442. \u0418 \u0432 \u0438\u0445 \u043f\u0440\u0435\u0432\u0435\u043d\u0442\u0438\u0432\u043d\u043e\u043c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u043d\u043e\u0435 \u0438 \u0432\u0441\u0435\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u0412\u0435\u0434\u044c \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u044f \u0437\u043e\u043d\u0430 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0432\u0441\u0435, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0443\u0439\u0434\u0451\u0442 \u0432 \u0442\u0435\u043d\u044c.\u0418\u043c\u0435\u043d\u043d\u043e \u0432\u0441\u0435\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f shift-left \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0431\u044b\u043b\u0430 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u043b\u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430, \u0430 \u043d\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u0443\u0436\u0435 \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d\u0435, \u0437\u0430\u0442\u0440\u0430\u0442\u044b \u043d\u0430 \u0435\u0451 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0443\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043c\u0435\u043d\u044c\u0448\u0435. \u0412 \u0441\u0432\u044f\u0437\u0438 \u0441 \u044d\u0442\u0438\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u0432 SAST-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0445 \u043c\u043e\u0436\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0441\u0442\u0438.\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0435\u0441\u044c \u043d\u0430\u0431\u043e\u0440 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b. \u0427\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, Java \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430\u0434 \u0435\u0433\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435\u043c.\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435. \u0420\u0430\u043d\u0435\u0435 \u043c\u044b \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u043b\u0438 \u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e SAST \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430. \u0421\u0440\u0435\u0434\u0438 \u044d\u0442\u043e\u0433\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0441\u0442\u0430\u0442\u044c\u044f N1, \u0441\u0442\u0430\u0442\u044c\u044f N2), \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0435 \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u043e\u0442\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445.\u0418 \u043f\u043e \u0438\u0442\u043e\u0433\u0443 \u043d\u0430\u0448 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043c\u043e\u0433 \u043f\u043e\u043a\u0440\u044b\u0442\u044c 9\/10 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 OWASP Top Ten.\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 OWASP Top Ten 2021\u041e\u043f\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 OWASP Top Ten \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443. \u041c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u0432\u0430\u043c \u043f\u0440\u043e \u0441\u0430\u043c\u0443 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e \u0438 \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u043a\u0430\u0436\u0435\u043c \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 PVS-Studio \u0432\u044b\u0434\u0430\u0451\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0435, \u043a\u0430\u043a \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435.A01:2021 \u2014 Broken Access ControlBroken Access Control \u2014 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438, \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0449\u0438\u0435 \u043a \u043d\u0435\u0441\u0430\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0438\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e \u0438\u043b\u0438 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u0438\u044e \u0432\u0441\u0435\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044e \u0431\u0438\u0437\u043d\u0435\u0441-\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u043f\u043e\u043b\u043d\u043e\u043c\u043e\u0447\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:public class RedirectServlet extends HttpServlet {    @Override  protected void doGet(HttpServletRequest request,                        HttpServletResponse response) throws IOException {    String query = request.getQueryString();    if (query.contains(&#171;url&#187;)) {      String url = request.getParameter(&#171;url&#187;);      response.sendRedirect(url);               \/\/ &lt;=    }  }}\u0421\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 PVS-Studio: V5324 Possible open redirect vulnerability. Potentially tainted data in the &#8216;url&#8217; variable is used in the URL. RedirectServlet.java 15, 14\u0421\u0435\u0440\u0432\u0435\u0440 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 GET \u0437\u0430\u043f\u0440\u043e\u0441, \u0431\u0435\u0440\u0451\u0442 \u0438\u0437 \u043d\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 URL-\u0430\u0434\u0440\u0435\u0441 \u0438 \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043e \u043d\u0435\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0443 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0438\u0448\u0438\u043d\u0433\u043e\u0432\u0443\u044e \u043a\u043e\u043f\u0438\u044e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:https:\/\/notevil.com\/redirect?url=https:\/\/evil.com\/registration\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u0448 \u0441\u0430\u0439\u0442 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0444\u043e\u0440\u043c\u0443 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0430. \u0418 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u0434\u0443\u043c\u0430\u044f, \u0447\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u0434\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435, \u043c\u043e\u0436\u0435\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 \u0441\u0432\u043e\u0438 \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u0410 \u043e\u043d\u0438 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0430\u043f\u0440\u0430\u0432\u044f\u0442\u0441\u044f \u043f\u0440\u044f\u043c\u0438\u043a\u043e\u043c \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0443.\u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043f\u0435\u0440\u0435\u0434 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443. \u0418 \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u043d\u0435 \u0432 \u0447\u0438\u0441\u043b\u0435 \u0434\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0445 \u2014 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u043e:private static final List&lt;String&gt; ALLOWED_DOMAINS = List.of(  &#171;https:\/\/allowed-host1.com&#187;,  &#171;https:\/\/allowed-host2.com&#187;,  &#171;https:\/\/allowed-host3.com&#187;);public class RedirectServlet extends HttpServlet {  @Override  protected void doGet(HttpServletRequest request,                        HttpServletResponse response) throws IOException {    String query = request.getQueryString();    if (query.contains(&#171;url&#187;)) {      String url = request.getParameter(&#171;url&#187;);      if (ALLOWED_DOMAINS.contains(url)) {      \/\/ &lt;=        response.sendRedirect(url);                    } else {        \/\/&#8230;.      }    }  }}\u042d\u0442\u043e \u043b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0437\u0430\u0449\u0438\u0442\u044b. C \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0448\u0438\u0440\u043d\u044b\u043c \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0443\u0431\u0440\u0438\u043a\u0435 Cheat Sheet \u0432 \u0431\u043b\u043e\u0433\u0435 OWASP. \u0412 \u043d\u0435\u0439 \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438 \u043f\u043e \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438.\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438:private final Path uploadDir = Path.of(&#171;\/var\/www\/uploads&#187;);@Overridepublic void init() throws ServletException {  try {    Files.createDirectories(uploadDir);    Files.setPosixFilePermissions(            uploadDir,            PosixFilePermissions.fromString(&#171;rwxrwxrwx&#187;));  \/\/ &lt;=  } catch (IOException e) {      throw new ServletException(e);  }}@Overrideprotected void doPost(HttpServletRequest req,                      HttpServletResponse resp) throws &#8230;. {  Part filePart = req.getPart(&#171;file&#187;);  Path target = uploadDir.resolve(Paths.get(filePart.getSubmittedFileName()));  try (InputStream in = filePart.getInputStream()) {    Files.copy(in, target, StandardCopyOption.REPLACE_EXISTING);  }  resp.getWriter().println(&#171;uploaded to &#187; + target);}\u0421\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 PVS-Studio: V5318 Setting loose POSIX file permissions (rwxrwxrwx) is security-sensitive. PermissionsExample.java 13\u0417\u0434\u0435\u0441\u044c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f \u0444\u0430\u0439\u043b\u044b, \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0430 \u0433\u0440\u0443\u043f\u043f\u0435 OTHERS. \u0412 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430. \u0418 \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, shell.jsp), \u0442\u043e \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a \u043d\u0435\u043c\u0443 \u043e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f (\u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 Tomcat \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c):https:\/\/example.com\/uploads\/shell.jsp\u0422\u0430\u043a, \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0434\u043b\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0432\u0435\u043b\u0430 \u043a RCE (\u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430). \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439 \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u043e, \u0432\u0430\u0436\u043d\u043e \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0439. \u0410 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0432\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u043f\u0440\u043e\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b.A02:2021 \u2014 Cryptographic Failures\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f Cryptographic Failures \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0433\u0440\u0443\u043f\u043f\u0443 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0438\u043b\u0438 \u0445\u0435\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 \u043d\u0435\u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u0438 \u0442.\u0434.\u041f\u0440\u0438\u043c\u0435\u0440:public static void callExternalApi() throws Exception {  SSLContext sslContext = SSLContext.getInstance(&#171;TLSv1&#187;);     \/\/ &lt;=  sslContext.init(null, null, new java.security.SecureRandom());  HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());  URL url = new URL(&#171;https:\/\/external-api.example.com\/data&#187;);    HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();  try (BufferedReader in = new BufferedReader(          new InputStreamReader(conn.getInputStream()))  ) {    String inputLine;    while ((inputLine = in.readLine()) != null)      System.out.println(inputLine);  }}\u0421\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 PVS-Studio: V5313 Do not use old versions of SSL\/TLS protocols as it may cause security issues. Insecure protocols: TLSv1. SSLExample.java 11\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 SSL\/TLS. \u0422\u0430\u043a\u0430\u044f \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u0430 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0442\u0430\u043a\u0438\u043c \u0430\u0442\u0430\u043a\u0430\u043c, \u043a\u0430\u043a Man-In-The-Middle, \u0435\u0451 \u043f\u043e\u0434\u0432\u0438\u0434\u0443 \u2014 BEAST, \u0438 \u0442.\u0434. \u0415\u0441\u043b\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0435\u0435, \u0442\u043e \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u043e\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 \u0438 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430\/\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u0430\u043c\u0438.\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0438\u0442\u044c \u0441\u0435\u0431\u044f, \u043b\u0443\u0447\u0448\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u043d\u043e\u0432\u043e\u0439 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u044d\u0442\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u2014 &#171;TLSv1.2&#187; \u0438\u043b\u0438 &#171;TLSv1.3&#187;.\u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0441\u043b\u0435\u0434\u0438\u0435\u043c legacy-\u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0438, \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c SAST-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u2014 \u043b\u0443\u0447\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e.A03:2021 \u2014 InjectionInjection \u2014 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0437\u0430 \u0441\u0447\u0451\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0435\u043d\u0430\u0434\u0451\u0436\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0438 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0435\u0441\u0442\u0430 (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u0430) \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0432\u0435\u0441\u0442\u0438 \u0441\u0435\u0431\u044f \u043d\u0435 \u0442\u0430\u043a, \u043a\u0430\u043a \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e. \u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u043f\u043e\u0440\u0447\u0430 \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0445 \u043e\u0431\u043d\u0430\u0440\u043e\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043b\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.\u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a \u0443 \u043d\u0430\u0441 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. \u041f\u043e\u043a\u0430\u0436\u0443 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u0430\u043c\u043e\u0439 \u0442\u0438\u043f\u043e\u0432\u043e\u0439 \u2014 SQL-\u0438\u043d\u044a\u0435\u043a\u0446\u0438\u0438. \u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0438 \u0441\u043e\u0431\u043e\u0439 \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u043d\u043e\u043c \u043a \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u2014 \u043f\u0440\u043e\u0441\u0442\u043e\u043c MVC-\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435. \u0417\u0430\u043e\u0434\u043d\u043e \u0438&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-475191","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/475191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=475191"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/475191\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=475191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=475191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=475191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}