Skip to content

Validate columnizer type names before loading or creating them - #745

Merged
Hirogen merged 1 commit into
Developmentfrom
fix/columnizer-type-validation
Oct 22, 2026
Merged

Hirogen merged 1 commit into
Developmentfrom
fix/columnizer-type-validation

Conversation

@Hirogen

@Hirogen Hirogen commented Oct 22, 2026

Copy link
Copy Markdown
Member

Columnizers stored in settings and .lxp files are restored by assembly-qualified type name. Two places trusted that name more than they should:

  • PluginRegistry.ColumnizerResolveEventHandler turned the requested assembly name straight into a file path under the application directory. It now accepts only plain assembly names: no path separators, no .., no drive or other invalid file-name characters. Plugin and application assemblies resolve exactly as before.
  • ColumnizerJsonConverter.ReadJson called Activator.CreateInstance on whatever Type.GetType returned. Now, a type that isn't a concrete ILogLineMemoryColumnizer falls through to the existing lookups, which only accept columnizers. It then fails with the same JsonSerializationException as an unknown type, without creating anything.

Tests

  • AssemblyResolverTests (new):
    • A relative assembly name pointing at a generated DLL outside the base directory resolves to null.
    • A plain assembly name still resolves.
  • ColumnizerJsonConverterTests: a non-columnizer type name throws and its constructor never runs.
  • PluginRegistry.Tests 345/345, LogExpert.Tests 1015 passed (7 skipped), Persister.Tests 105/105.

The assembly resolve handler now only accepts plain assembly names, so a
type name read from a settings or .lxp file can no longer point it at a
DLL outside the application and plugin directories.

ColumnizerJsonConverter only creates instances of concrete
ILogLineMemoryColumnizer types; any other type name is treated like an
unknown type.
Comment on lines +44 to +47
catch
{
// The DLL stays locked if a regression loaded it; the assertion already reported that.
}
@Hirogen
Hirogen merged commit 2ae0070 into Development Oct 22, 2026
3 checks passed
@Hirogen
Hirogen deleted the fix/columnizer-type-validation branch October 22, 2026 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant