Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphvizGrapher.getNodeLabel doesn't htmlEscape subtitle, possible invalid <table> HTML if subtitle contains invalid characters (e.g. '<', '>', etc) #1837

Open
f-luo opened this issue Oct 25, 2024 · 0 comments

Comments

@f-luo
Copy link

f-luo commented Oct 25, 2024

We ran into an edge case where node.getSubtitles() returns a string that contains unsafe HTML characters such as '<' and '>'. For context, the subtitle contains Java type angle brackets (e.g. Foo<? extends Bar>).

This resulted in errors when compiling the .dot file.

A possible fix might be to htmlEscape(subtitle) before appending it to the StringBuilder html: https://github.com/google/guice/blob/master/extensions/grapher/src/com/google/inject/grapher/graphviz/GraphvizGrapher.java#L148

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

No branches or pull requests

1 participant