At third level, a Barbarian can take the Path of the Totem Warrior, gaining (among others), the following feature:
Yours is a path that seeks attunement with the natural world, giving you a kinship with beasts. At 3rd level when you adopt this path, you gain the ability to cast the Beast Sense and Speak with Animals spells, but only as rituals.
According to this question, that would make the Totem Warrior a Spellcaster.
What is the spellcasting ability of a Totem Warrior?
Is there any situation where that is relevant?
You do not have a spellcasting ability
The spells that the Totem Warrior archetype allows you to cast are beast sense, speak with animals and commune with nature, none of which require a spellcasting ability.
Therefore, neither the Spirit Seeker or Spirit Warrior features (PHB, p. 50) mention a spellcasting ability, so this would be the same case as the Thief rogue's Use Magic Device feature - you don't have a spellcasting ability.
For situations where you did need a spellcasting ability (see the second half of my answer for when this would be), the only guidance provided on this is for using magic items; taken from DMG, page 141 (borrowed from this answer):
Since you don't have a spellcasting ability, your spellcasting ability modifier is therefore +0. So your spell attack bonus would be your proficiency bonus by itself and your spell save DC would just be 8 + your proficiency bonus.
But in practice, it only matters for a few edge cases
For most magic items, those that specify that they use your spellcasting ability tend to be those that also require you to be of a specific class to be able to attune to it, such as the Staff of the Woodlands needing you to be a druid, not just any spellcaster. Those that do allow any spellcaster tend to include static DCs that are separate from your spellcasting ability, such as the various wands in the DMG.
However, there is one item that does allow any spellcaster to attune to it, yet references your spellcasting ability, and that is the Voyager Staff from Guildmaster's Guide to Ravnica (thanks to @David Coffron).
Other magic items exist that do not require you to be considered a spellcaster at all, such as explored in this question, that allow the user to cast wish to duplicate spells that involve saving throws (thanks to @Medix2). So that would also include the Luck Blade, the Ring of Three Wishes, a certain card from the Deck of Many Things, and being attuned to both the Eye and Hand of Vecna to our list of "edge cases for where this is relevant".
There's also an item from Waterdeep: Dungeon of the Mad Mage called the Black Crystal Tablet that allows anyone with proficiency in Arcana to attune to it, which allows you to cast eyebite but without specifying a save DC (thanks to @Medix2). This item would also require you to use your spellcasting ability, as explored in this question.
So using these items would make this become relevant for a Totem Warrior barbarian. But there is one more edge case (found by @Medix2); the Arcane Trickster rogue's Spell Thief feature (PHB, p. 98). If any character (which includes this barbarian) were to cast a spell that affects an Arcane Trickster (say, using wish from a Luck Blade), this feature would force the "spellcaster" to use their spellcasting ability for a saving throw. In this barbarian's case (or any other "spellcaster" who doesn't actually have a spellcasting modifier), that would be as per the first part of my answer.
However, there is one final edge case that is a variation of the previous one minus magic items. If an Arcane Trickster rogue/druid was under the effect of Wild Shape such that they are currently considered a beast, making them an eligible target for beast sense (a spell that a Totem Warrior barbarian already has without needing magic items to grant it to them), and the barbarian cast beast sense on them, then the Arcane Trickster could use Spell Thief, which forces the barbarian to make a saving throw using their own spell save DC. At this point, since no magic items are involved, the rule I quoted in the first part of my answer doesn't apply.
In this case, since the Totem Warrior barbarian isn't given a spellcasting ability by the feature that gave them access to the spell (namely the Spirit Warrior feature), then they have no spellcasting ability, and it is therefore unclear what the DC for this saving throw should be in this scenario.
At this point, it would be up to the DM to adjudicate, since there are no other rules I am aware of to fall back on. It would be reasonable to make a ruling based on the magic items rules I've been relying on thus far in my answer, or perhaps a DM could rule that they use Wisdom as their spellcasting ability since beast bond is a druid/ranger spell (both of whom use Wisdom), or whatever else a DM might think is reasonable. But it seems that the rules are silent on this particular edge case.