Which option is more secure?
I don’t think it matters.
If your host system is compromised both would be susceptible.
Just use both.
I prefer using SSH for known config changes or checking logs/connections.
And the UI for updates, backups, and quick status glance or discovery of available settings.
I like my webUI for pretty much everything.
I really dont use SSH. Maybe I should but the years of using the older Microsoft ecosystem in my younger years make it hard for me to go for a CLI option when a GUI option is available.
Bonus if you disable SSH, you would not have been affected by the recent XZ utils backdoor, but who knows what else would break.
OpenWrt was never impacted by this.
I understand, I was am just thinking about SSH vs a webUI as an overall preference.