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 6548399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:58:03+00:00 2026-05-25T11:58:03+00:00

I have some JavaScript which retrieves a user-submitted querystring value, sets a hidden field’s

  • 0

I have some JavaScript which retrieves a user-submitted querystring value, sets a hidden field’s VALUE to the parameter, then posts the form automatically.

This is all done on page load. Is there any potential for XSS?

<script>
    function autoSubmit(){
        var url = ... /* retrieve URL from querystring parameter */
        document.getElementById("txt").value = url;
        document.getElementById("myform").submit();
    }
</script>
<!-- ...... --->
<body onload="autoSubmit()">
<form id="myform" name="myform" method="POST" action="http://www.mysite.com/someform.php">
 <input id="txt" name="txt" type="hidden" value="" />
</form>
</body>
  • 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-25T11:58:03+00:00Added an answer on May 25, 2026 at 11:58 am

    No. You are not executing remote code anywhere and you aren’t allowing users to enter their own Markup.
    But are you sure you are concerned about XSS?

    The site is likely vulnerable to some form of XSRF for the usual XSRF Reasons:

    • I’m asuming (since you mentioned query parameters) you are loading this page via a HTTP GET, yet it directly leads to a POST which (likely) modifies data in some way. Users might be tricked into clicking a link with evil parameters (sessionstealing?)
    • Again: Asuming you have not taken any other precautions, posting from a remote location might have the same effect.

    More in depth anaylsis would require looking at your someform.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some javascript which catches changes to a form then calls the form's
Hi I have a usercontrol which includes some JavaScript, if I add the control
I am using some pre-written JavaScript from polldaddy. They have a JavaScript option which,
I have some Javascript which animates a colour change on an HTML element, as
I have some JavaScript which is changing an image correctly but once it has
I have a textarea which I'm using JavaScript to retrieve the value of and
I have some javascript that I'm trying to retool using jQuery to learn the
I have some javascript that goes out and fetches a javascript class on another
i have some javascript roll over code that works fine in firefox but when
I have some Javascript code that will programmatically register an COM interop assembly by

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.