From Test-Scratch-Wiki
Yes, Scratch is completely secure.
It is transmitted over HTTPS, which is a secured form of HTTP. It also "sanitizes database queries," which prevents hacking, and is open source, which makes it very hard to sneak malware in. You should, however, follow common Scratch Safety.