Let $S$ be a finite set and $F$ is the free group on that set. Is there an algorithm which takes as input a sequence of $w,w_1,\ldots,w_k\in F$ and decides whether $w\in \langle w_1,\ldots,w_k\rangle$?

This question keeps appearing in some of my work. My intuition is that this has been solved somewhere. It seems very related to the Nielsen-Schreier theorem and, to my understanding, Nielsen's proof of this theorem gave an algorithm for finding a free generating set for any finitely generated subgroup of a free group - which is very closely related to this problem. I also have found various literature referring to this as a "generalized word problem" and various undecidability results relating to the problem in general - but, even though nothing suggests that this is undecidable for a free group, I've not come across any algorithm for deciding it.