Preheat oven to 350ºF. Line an 8-inch-square baking dish with foil, leaving enough of the foil hanging over the edges to use as handles. Butter and flour the foil.
In a large bowl, combine flour, sugar, cocoa powder, baking soda, and salt with an electric mixer until free of lumps, sifting if necessary. In a medium bowl, whisk together egg, oil, buttermilk, food coloring, vinegar, and vanilla until blended. Add this to the flour mixture and mix on low speed at first, and then on medium-high speed until the batter is thick and velvety, 2 to 3 minutes. Pour into the prepared pan, and bake until a toothpick inserted in the center comes out clean, 30 to 35 minutes. Cool on a rack for 10 minutes. Using the foil, lift the cake out of the pan and onto a rack. Spread out the foil and let the cake cool completely.
In a large bowl, combine cream cheese and butter with an electric mixer. Beat on high speed until creamy, 2 to 3 minutes. Beat in the vanilla on medium-low speed. Sift the sugar into the cream cheese mixture in batches, beating in each batch on medium-low speed and scraping down the sides of the bowl as necessary. Spread the frosting over the top of the cake, and cut it into 9 squares.
Tip: Be careful when handling red food coloring; it stains easily.