(Sharecast News) - Chinese social media giant TikTok has taken measures to halt a cyber-attack aimed at several brand and celebrity accounts.

TikTok said on Wednesday that it has been "collaborating closely" with CNN to restore account access and implement enhanced security measures to safeguard its account moving forward, noting that the number of accounts compromised was "very small".

According to Reuters, reality TV star Paris Hilton's account was targeted but had not been compromised.

The attack comes as parent company ByteDance challenges a law that requires it to sell TikTok by next January or face a ban in the US as the White House looks to see Chinese-based ownership ended on national security grounds despite promises that it will not share US user data with the Chinese government.

The legal challenge may very well argue that a blanket ban will deprive TikTok's 170.0m US users of their First Amendment rights to freedom of speech and will likely also face opposition from creators who rely on the app for their income. China has previously vowed to oppose a forced sale.

Reporting by Iain Gilbert at Sharecast.com