Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Issue] User email gets exposed. #4

Closed
legacyxdd opened this issue Jul 18, 2024 · 16 comments
Closed

[Security Issue] User email gets exposed. #4

legacyxdd opened this issue Jul 18, 2024 · 16 comments

Comments

@legacyxdd
Copy link

legacyxdd commented Jul 18, 2024

I found an important security vulnerability. The visitor can easily view the user's email using console network tab. I tried to fix this myself but couldn't find a solution. I think it needs to be fixed immediately, thanks!
image

@r2hu1
Copy link
Owner

r2hu1 commented Jul 18, 2024

haha i knew it actually i am thinking to add email in there profile where visitor can directly email them if they want

@r2hu1
Copy link
Owner

r2hu1 commented Jul 18, 2024

i am currently working on https://url-shrtner.vercel.app after it i will try but its not an bug its an upcoming feature 😁

@legacyxdd
Copy link
Author

haha i knew it actually i am thinking to add email in there profile where visitor can directly email them if they want

ohh I understand, that's actually a good idea. Good luck on the new project.

@legacyxdd
Copy link
Author

btw removing the email from NextResponse in api files doesn't seem to be working. I would be really happy if you can tell me an other way to fix it or I think I will be waiting for the update 🙌🙌

@legacyxdd legacyxdd reopened this Jul 18, 2024
@r2hu1
Copy link
Owner

r2hu1 commented Jul 18, 2024

actually i checked it, the schema has email property thats why it is returning it but if you really wanto remove the email return everything except email in app/api/page/get/route.js like its returning return NextResponse.json({ data }, { status: 200 }); change it to {data.name, data.bio, ....continue} then it will not return email

@legacyxdd
Copy link
Author

Hmm, when I do that it returns this error:
TypeError: Cannot read properties of undefined (reading 'image')
app(page)_components\UserSocials.jsx (42:44) @ image

(btw data.name ... gave syntax error, I did name, bio ...)

@legacyxdd
Copy link
Author

and when I remove setImage(data.data.image); then it gives same error for name in here setName(data.data.name);

@legacyxdd
Copy link
Author

Hey bro, I also fixed that issue by removing the email part from the data in the API.

How did you host the project on Vercel? When I try to host it, the API doesn't work at all.

@legacyxdd
Copy link
Author

I still couldn't figure it out, searched on Google aswell but nothing familiar comes up. 😥

@r2hu1
Copy link
Owner

r2hu1 commented Jul 19, 2024

did you added the env variables in vercel project settings? make sure to redeploy after adding it

@legacyxdd
Copy link
Author

Yes I added them when building, also redeployed the project now. The API still doesn't work, user profiles and dashboard doesn't load. 🤔

@r2hu1
Copy link
Owner

r2hu1 commented Jul 21, 2024

can i get the repo url?

@r2hu1 r2hu1 closed this as completed Jul 21, 2024
@legacyxdd
Copy link
Author

Hey bro really sorry for the late reply. I didn't had access to my pc.

Instead of the repo url, can you just tell me how you published this project on vercel? I did add my variables too but it doesn't work. I can access the site but the database can't be reached. (so user pages doesn't load)

@r2hu1
Copy link
Owner

r2hu1 commented Aug 8, 2024

i just imported this repository on vercel dashboard thats it and redeploy after adding env variables

@legacyxdd
Copy link
Author

I did the exact same, but my api/get doesn't load. I can see this on chrome dev tools

An error occurred with your deployment
FUNCTION_INVOCATION_TIMEOUT

@legacyxdd
Copy link
Author

I searched for it online but nothing solved the problem 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants