Summary
A code injection vulnerability in SeaCMS affects the Template Engine's parseIf function when processing the searchtype argument. A remote attacker may be able to inject code through a reachable search-related request when the vulnerable parsing path processes attacker-controlled input.
Affected context
The vulnerability occurs in SeaCMS deployments up to version 13.6 where the Template Engine processes the searchtype argument through the parseIf function in search.php. Risk depends on whether the affected endpoint is remotely reachable and whether attacker-controlled input reaches the vulnerable parsing logic without sufficient separation between data and executable template expressions.
Exploit preconditions
- Attack surface: A remotely accessible SeaCMS search or template-processing request
- Required access: Access sufficient to submit or influence the
searchtypeargument; authentication requirements depend on deployment configuration - Trigger point: Processing of the argument by the Template Engine's
parseIffunction - Why exploitation is possible: Input is interpreted in a code-processing context, allowing crafted values to alter evaluation behavior rather than being handled strictly as inert data
Why this happens
The underlying bug is insufficient separation between untrusted input and executable expression or template logic. When the parseIf function processes attacker-influenced searchtype data without strict allowlisting and contextual encoding, specially constructed input may be interpreted as code. This behavior maps primarily to CWE-94: Improper Control of Generation of Code, with CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component describing the broader injection pattern.
Potential impact
- An attacker may execute unintended code in the SeaCMS application context
- The application or hosting account could be compromised
- Sensitive application data could be disclosed or modified
- Website content, templates, or stored records could be tampered with
- The server could be used for further attacks, depending on process privileges and network access
General mitigation guidance
Mitigation generally focuses on ensuring that user-controlled values cannot become executable template or expression logic.
Common defensive patterns include:
- Treating search parameters as data and avoiding dynamic evaluation
- Replacing expression construction with fixed, parameterized control flow
- Applying strict allowlists for values accepted by
searchtype - Validating input before template parsing and rejecting unexpected structures
- Separating template compilation from request data processing
- Running the application with the least privileges needed and limiting its access to sensitive resources
- Restricting unnecessary exposure of administrative and template-related endpoints
How teams detect issues like this
Organizations can look for this vulnerability through:
- Static analysis rules identifying dynamic evaluation, template interpretation, or code generation based on request parameters
- Code review checks for uses of
searchtypeor similar values in expression-building paths - Tests that submit unexpected syntax and verify that values remain inert data
- Web-application logs showing unusual search parameter structures or repeated probing of template-processing endpoints
- Policy enforcement requiring allowlisted input handling and prohibiting runtime evaluation of untrusted request data
- Neutral automated security review tools that flag injection-prone parser and evaluator patterns

