Summary
A flaw in SuiteCRM's Studio Dropdown Editor allows an administrator-controlled dropdown name to be written into a PHP language file after HTML entity decoding. When the file is later included, injected PHP may execute as the web-server account, putting application and host confidentiality, integrity, and availability at risk.
Affected context
The issue affects SuiteCRM installations using the Studio Dropdown Editor in versions prior to 7.15.2 and 8.10.2. The editor writes the decoded dropdown name into a PHP language file under custom/, which is included on later page loads; cache clearing does not remove the persisted file.
Exploit preconditions
- Attack surface: The Studio Dropdown Editor and its generated PHP language file.
- Required access: Administrator access sufficient to create or modify dropdowns.
- Trigger point: A later page load that includes the generated language file.
- Why exploitation is possible: Decoded input is written verbatim into executable PHP rather than being constrained to safe data.
Why this happens
The application treats administrator-supplied data as PHP source when generating a language file. HTML entity decoding does not make input safe for code generation, and writing the result into a file that is later included creates a code-injection condition. This maps to CWE-94: Improper Control of Generation of Code ('Code Injection').
Potential impact
- An attacker with the required administrator access may execute PHP as the web-server account.
- Application data and files could be exposed or modified.
- The application or host could become unavailable.
- Malicious code may persist across cache clears and subsequent page loads.
General mitigation guidance
Defensive patterns focus on keeping data separate from executable code:
- Store dropdown labels and values in a data format or database rather than generating PHP source.
- If file generation is necessary, use safe serialization or templates that encode values as data, not code.
- Apply strict validation and context-appropriate encoding to values before storage and use.
- Restrict who can create or modify dropdowns, and run the web application with least-privilege permissions.
- Monitor and protect generated files against unauthorized modification.
How teams detect issues like this
- Use static analysis to identify user-controlled values written into source files or other executable artifacts.
- Review code-generation paths for decoding or escaping steps that do not preserve the data/code boundary.
- Check whether generated PHP files are included dynamically and whether their contents can be influenced through administrative features.
- Apply policy checks that prohibit runtime features from writing untrusted values into executable files.
- Monitor generated files for unexpected changes and review relevant application logs.

