Skip to content

In-depth lesson · RCE

Typical fixes

Every point the RCE reports back under this heading, best-backed first, each with the reports it is seen in.

Back to the lesson 1 to 50 of 450
  1. Treat configuration values as inert data and never pass them into a code-execution function.

    Seen in 21 reports
  2. Pass untrusted values as safely quoted arguments or environment variables rather than interpolating them into the command text.

    Seen in 20 reports
  3. Do not check out or run code from the pull request's fork in a pull_request_target workflow; use the unprivileged pull_request event for untrusted code, or require approval before running fork code.

    Seen in 19 reports
  4. Avoid building shell commands from user input and pass arguments as separate values instead.

    Seen in 17 reports
  5. Pass arguments as separate values instead of building shell command strings.

    Seen in 17 reports
  6. Pass user-supplied values as separate escaped arguments instead of concatenating them into shell command strings.

    Seen in 17 reports
  7. Escape shell metacharacters and avoid concatenating user input into shell command strings.

    Seen in 14 reports
  8. Restrict deserialization to a whitelist of allowed classes and validate incoming serialized data.

    Seen in 12 reports
  9. Sanitise or escape user input before passing it to a shell, or avoid the shell entirely.

    Seen in 12 reports
  10. Restrict which classes can be deserialised and validate incoming serialised data.

    Seen in 10 reports
  11. Restrict which object types may be reconstructed when loading checkpoints, or use a safe format that carries no executable objects.

    Seen in 10 reports
  12. Validate and restrict the classes that can be instantiated when deserializing untrusted input.

    Seen in 10 reports
  13. Build system calls with argument separation and escaping rather than string concatenation.

    Seen in 9 reports
  14. Validate the source markup of uploaded application packages before processing them.

    Seen in 9 reports
  15. Do not call unserialize on user-controlled input; use a safe format such as JSON and validate the value.

    Seen in 8 reports
  16. Do not insert untrusted pull request data into scripts, and do not check out and run pull request code in workflows that use pull_request_target.

    Seen in 8 reports
  17. Do not pass user input to create_function or eval; use a fixed allow-list of sort columns and directions.

    Seen in 7 reports
  18. Restrict which object types a deserialiser may reconstruct and validate data before deserialising.

    Seen in 7 reports
  19. Do not write user-supplied values into executable PHP files; store data in a non-executable format and escape output.

    Seen in 6 reports
  20. Filter or allowlist classes accepted during deserialisation.

    Seen in 6 reports
  21. Properly validate user-supplied data before deserialisation.

    Seen in 6 reports
  22. Sanitise or strip Java EL expressions from user-controlled data before passing it to constraint violation message templates.

    Seen in 6 reports
  23. Validate and escape user-supplied filenames, URL strings and request header values before they reach a system call, or avoid shell invocation entirely.

    Seen in 6 reports
  24. Validate and safely handle data returned by the server before processing it in the client driver.

    Seen in 6 reports
  25. Avoid passing user-supplied strings to shell calls, or escape them properly before use.

    Seen in 5 reports
  26. Fix the flaw in on-premises Azure Site Recovery components that allows code execution with administrative access.

    Seen in 5 reports
  27. Update Log4j to a version that does not process JNDI lookups in logged messages.

    Seen in 5 reports
  28. Avoid building shell command lines from user input; use argument arrays and validate fields against strict allow-lists.

    Seen in 4 reports
  29. Clear global pointers into the request heap after fatal errors and reset worker globals before each request.

    Seen in 4 reports
  30. Do not interpolate pull request or comment text into shell commands, and pass untrusted values through environment variables.

    Seen in 4 reports
  31. Do not pass user input to evaluation or execution functions; use a sandbox that restricts what code can reach.

    Seen in 4 reports
  32. Escape or validate user-supplied arguments before concatenating them into shell commands.

    Seen in 4 reports
  33. Microsoft judged the flaws architectural and disabled RemoteFX rather than patching it.

    Seen in 4 reports
  34. Pass untrusted values through environment variables instead of interpolating them into shell commands.

    Seen in 4 reports
  35. Sanitise branch names and filenames before using them in run steps or writing them to the output file.

    Seen in 4 reports
  36. Use type allow-lists and secure coding flags, and never deserialise unauthenticated input.

    Seen in 4 reports
  37. Validate and restrict what is deserialised, and verify signatures before deserialising token or session data.

    Seen in 4 reports
  38. Validate input before loading libraries and correct how the application resolves library paths.

    Seen in 4 reports
  39. Validate user-supplied data and restrict the types that can be instantiated during deserialisation.

    Seen in 4 reports
  40. Avoid building shell commands from user input; use argument lists and escaping, and run with least privilege.

    Seen in 3 reports
  41. Avoid passing user input to a shell; use argument arrays and separate options from values with a delimiter.

    Seen in 3 reports
  42. Configure package managers to resolve dependencies only from the internal registry, or claim internal names on the public registry.

    Seen in 3 reports
  43. Do not deserialise untrusted input; restrict which classes can be instantiated and validate serialised data strictly.

    Seen in 3 reports
  44. Do not unserialise cookie values; validate and restrict the data, or use a signed safe format.

    Seen in 3 reports
  45. Ensure links that invoke the Protected View protocol cannot bypass protection.

    Seen in 3 reports
  46. Escape formula characters at the start of each cell, not just the whole field, and account for newline and semicolon delimiters.

    Seen in 3 reports
  47. Escape or validate firmware update parameters before using them in shell commands.

    Seen in 3 reports
  48. Match the full request path in authentication filters and validate input before shell use.

    Seen in 3 reports
  49. Parse untrusted fields with a restricted grammar and treat stored data as data rather than evaluating it.

    Seen in 3 reports
  50. Remove default administrator credentials and require strong authentication on exposed admin interfaces.

    Seen in 3 reports