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.
-
Validate user-supplied input before using it in system calls in the password change mechanism.
-
Validate user-supplied strings before using them in system calls.
-
Verify the authenticity and integrity of software update packages before installing.
-
Account for all batch file extensions when deciding whether to treat a file as a batch script.
Seen in 1 report
-
Add a @JsonProperty annotation to the JavaScriptConfig parameter so an empty JSON key cannot override it.
Seen in 1 report
-
Add access controls and restrictions to dangerous functions exposed by the gateway server.
-
Add authentication to the REST endpoint and validate user-supplied class and method names used in reflection.
Seen in 1 report
-
Add authorisation checks on settings modification and sanitise input before shell and SQL use.
-
Add bounds checking when copying user-supplied filenames into fixed-size buffers, and enable stack cookies.
Seen in 1 report
-
Add CSRF tokens to the CKEditor configuration form and validate user-controlled input passed to getimagesize().
Seen in 1 report
-
Add input sanitisation in core processes and library APIs.
Seen in 1 report
-
Add length checks when appending XML element names to a fixed global buffer.
Seen in 1 report
-
Add proper access controls to the PJL command handler.
-
Add the ObjRef gadget to the deserialisation blacklist.
-
Add unit testing and code consistency checks to prevent regressions in the restapps module.
Seen in 1 report
-
Add validation and authorisation to endpoints reachable from the adjacent network.
Seen in 1 report
-
Apply the macOS quarantine attribute to downloaded files before they are opened.
Seen in 1 report
-
Apply the same class restriction on the parser side as on the serialiser side.
Seen in 1 report
-
Avoid using BinaryFormatter and SoapFormatter for deserialising untrusted remoting messages.
Seen in 1 report
-
Avoid using Python pickle for cache serialisation or restrict access to the cache store.
Seen in 1 report
-
Bind cache upload links to a single upload and make them non-reusable.
Seen in 1 report
-
Block access to boxed primitive type TYPE fields in the JEXL sandbox.
-
Block access to constructor properties and the Function constructor in expression evaluators.
Seen in 1 report
-
Block and remove the vulnerable AEAD module as a temporary mitigation, then patch the kernel and reboot.
Seen in 1 report
-
Block HTTP dependency downloads and change defaults to encrypted transport with integrity checks.
-
Block re-installation once installed and use a safe serialisation format for configuration files.
Seen in 1 report
-
Build the application with Hardened Runtime and disable the Allow DYLD Environment Variables entitlement.
Seen in 1 report
-
Call CertUtil.exe using its full path instead of relying on the current working directory.
Seen in 1 report
-
Change default admin credentials and do not expose the device online.
-
Check the full class hierarchy, including superclasses and interfaces, against the blocklist.
-
Check the length of the target MAC parameter before copying it into a fixed-size buffer.
Seen in 1 report
-
Check the type of the source parameter in the Factory class before using it as a configuration.
Seen in 1 report
-
Check the validity and revocation status of signing certificates before running downloaded executables.
-
Correct how SMBv1 handles crafted requests.
Seen in 1 report
-
Correct how Windows handles objects in memory.
Seen in 1 report
-
Detect incoming HTTP connections and close them before executing any code.
Seen in 1 report
-
Disable automatic superuser login by default and require credentials.
-
Disable dangerous functions in configuration or sandbox execution rather than relying on a name-based blacklist.
Seen in 1 report
-
Disable external entity processing in the XML parser.
Seen in 1 report
-
Disable the vulnerable parser rather than patching it.
Seen in 1 report
-
Disable the Werkzeug debugger in production deployments.
Seen in 1 report
-
Do not allow user-controlled template strings to call exported methods on the data object.
Seen in 1 report
-
Do not bind-mount hostPath sources read-write into the VM share directory.
Seen in 1 report
-
Do not build shell commands from filenames; pass arguments without a shell and sanitise metacharacters.
Seen in 1 report
-
Do not check out and build pull request code in a workflow triggered on pull_request_target.
Seen in 1 report
-
Do not choose a deserialisation function from the file extension; validate content and warn the user.
Seen in 1 report
-
Do not derive API credentials from publicly available identifiers such as MAC addresses.
Seen in 1 report
-
Do not deserialise Java objects from server responses without validation.
-
Do not evaluate decoded and decrypted environment variables.
Seen in 1 report
-
Do not evaluate metadata strings; parse them with a strict parser instead.