Common
IDOR in RoR
Добавление .json к пути, если у нас Ruby
Redirections
Обращать внимание на redirect_to
. Пользовательский ввод не должен попадать сюда.
? Этот URL приведет к отрисовке формочки в Firefox и Opera:
RCE Flows
Command Injection
Code Execution
open-uri
Если используется в коде этот пакет, то есть возможность исполнить код на стороне сервера (так как используется внутри Kernel.open)
Пример кода уязвимого
Payloads:
Mitigation: переходить на openURI
.
Unsafe Jobs
delayed jobs (e.g. ActiveJob, delayed_job) whose classes accept sensitive data via a perform
or initialize
method. Jobs are serialized in plaintext, so any sensitive data they accept will be accessible in plaintext to everyone with database access. Instead, consider passing ActiveRecord instances that appropriately handle sensitive data (e.g. encrypted at rest and decrypted when the data is needed) or avoid passing in this data entirely.
When a RegistrationJob
gets queued, this job will get serialized, leaving both password
and authorization_token
accessible in plaintext. Betterment/UnsafeJob
can be configured to flag parameters like these to discourage their use. Some ways to remediate this might be to stop passing in password
, and to encrypt authorization_token
and storing it alongside the user object. For example:
By default, this job will look at classes whose name ends with Job
but this can be replaced with any regex.
Macros & Regexp -> Dinamic Params
Render / SSTI
Last updated