How to protect my own ideas/solutions when another of my supervisor's students is studying the same thing? Edit: Since teamwork has come up in the answers, I think it would be useful that I add this. The other student has requested to team up with me, and the advisor has rejected this. Besides, I already have the solution to my research question. Not much left for teamwork on that section. I will have to share my solution with my supervisory panel, and then start the evaluation which I can't and rather not to do in secrecy.

A student recently moved from another area to study with my supervisor. Along with this change in supervisor, the student has also changed direction and has started working on the same problem as mine.

The change in subject is quite a sharp turn too. For example, think of a student with a background in microbiology(all the way up to masters and over one year work of their PhD), suddenly starts working on a machine learning model for aggression in dogs. While I have deidentified the subjects, the problem I have been working on is even more specific than the imaginary dog problem. It might be worth adding that the subject of my study was proposed by myself after over two months of literature review. 

The change sounded weird to me at first, but I wasn't worried until I saw part of my study plan and one of my ideas in this student's review presentation. 

I am sure that this has been my big mouth not keeping what I say in check, primarily because I usually think very positively of people. I can keep my mouth shut from now on, and the supervisors I have are quite good. However, I imagine they have quite a challenging task in remembering which idea/solution was shared by which one of their students, and not to talk about it to the other student unintentionally.

I am not sure why the hell someone would throw away years of background and start working on something that they have no background in and is already being studied under their nose. A tough challenge is that how do I exchange information without a worry that these ideas might leak out? One of my supervisors is a very busy person, I am sure that this person has a fantastic memory. However, is it possible that they forget which idea was shared by who? and unintentionally share it with the other student? 
What should I do? Suggestions?

To my principal supervisor, if they happen to see this:
Please do not take offence, I have great respect for you and will always be grateful for all the incredible support I have received. This issue is part of my learning process, and I'd like to tap into all resources available to me so I can tackle and learn about it to the best of my capability.

/walloftext
Teamwork

It's rather common for teams to work on "the same thing" research wise - on a single project, shared research and (most importantly) collaborating and sharing ideas, not hiding them from each other. That is a good thing.

It may be dependent on the field, but I'd guess that having such teamwork is far more common than a "two person" team of a supervisor and a single student.

The attribution of a particular idea within a single team isn't that important - doing the work in implementing and verifying that idea is almost all of created value in a research project. Simply coming up with an idea for possible work and nothing else generally justifies a mention in acknowledgements, not even a co-authorship. Since there are more valid research ideas than time to work on them properly (and this is true even if a student needs two months of literature review to pick one suited for him/her), it is rather expected for advisors to spread interesting research ideas around - it often takes years and multiple attempts to do a particular idea properly, and treating it as "taboo" because someone else is working on it would be rather counterproductive.

If you have two or more people working on a single sufficiently large problem, that's great - you will inevitably specialize to certain parts of that problem and depending on how you (or your supervisor) organize the work, you can co-author the resulting publications or split the results in smaller pieces to publish separately; but you will go further beyond the other researchers in the same subfield than if you were struggling at it alone.