Using gl_VertexID without any VBOs.
Normally, gl_VertexID is the index of the currently rendered vertex element.
When you provide indices (GL_ELEMENT_ARRAY_BUFFER), gl_VertexID should match the value provided. Ie, the gl_VertexID value can repeat if you render the same element multiple times.
I say “should”, because this is NOT correct when you haven’t provided any VBO data.
This means, that if you are rendering using nothing but a shader and a GL_ELEMENT_ARRAY_BUFFER, the gl_VertexID will NOT match the indices you provide, and will instead be a sequence from 0 -> N.
The solution is to use a single VBO and use glDrawArrays.
Personally, I consider this a bug.