I've just tried everything and I cannot seem to fix this for the life of me.
Basically, Safari has started reporting the following error in the JS console: "SecurityError: DOM Exception 18: An attempt was made to break through the security policy of the user agent." Most of Ajax interactions via https are not working, so I cannot log into Twitter, Facebook or even Apple's own Developer Center.
I've tried installing Webkit, and even removing all preferences files that I'm aware of.
Other local browsers (Firefox, Chrome, Opera...) work just fine. I'm using Safari 7.0.2 in Mavericks.