The seals at the top of the leg are known as dust wipers and need regular replacement. They are a consumable part. Inside the seal is a foam donut that wipes any dust that makes it past the rubber seal. Eventually the accumulated dust starts chewing at the legs.
Service intervals depend on the amount of use the bike gets and how dusty your local area is but 50-100 hours is a number thrown around lots. Check the manual for your fork.
You or your bike shop need perform at least a "lower leg service" which is pretty easy to do at home with regular service tools. Theres lots of YouTube videos on the topic.
Dust wiper, foam seal and crush washer kit
Since it hasn't been serviced since 2017 you should consider a full service which is better done by a pro unless you really want to learn about fork servicing and buy the special tools like C-Clip pliers, upper leg sockets and parts/oils/syringes. Not impossible, but easy to mess up and best with a workshop. If the fork feels "notchy" when you compress it thats a big clue that a full service is required.