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

  • Home
  • SEARCH
  • 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 8491209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:20:57+00:00 2026-06-10T22:20:57+00:00

On this page it says The htmlspecialchars() may be used when printing the SID

  • 0

On this page it says

The htmlspecialchars() may be used when printing the SID in order to prevent XSS related attacks.

What possible attack can someone do if you print the SID without using htmlspecialchars() ?

The session ID can only contain numbers and letters. Am I missing something?

  • 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-06-10T22:20:59+00:00Added an answer on June 10, 2026 at 10:20 pm

    Session ID is usually stored on the client (eg. in the cookie or in the GET params), so it can be altered – by some script or even by altering the URL.

    Now imagine someone that was able to alter the cookie and change SID to some JS code redirecting you to some other place. If you will print that value on your page unescaped, the user will be redirected every time unless he will clear the cookies or disable JavaScript.

    In other words, session ID is taken from the client and is unsecure (unless you will use additional mechanism ensuring it was not altered, such as cookie signing, included in eg. some PHP frameworks), so you cannot trust it does not contain something harmful.

    This is the same reason you must not use this value as safe when constructing the SQL queries (so SID is also a place where SQL injection is possible).

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

Sidebar

Related Questions

This page says about order for library search in ld.so : Unless loading object
In a dex file, for what purpose is the LEB128 used? This page says
I was reading on this page and it says dynamic_cast can be used only
This page says to use: var object = $.extend({}, object1, object2); But I prefer
This page has been quite confusing for me. It says: Memory management in newLISP
Reading this page , it says: ...the URI in a PUT request identifies the
On this test page: http:// www.onebagoneearth.com/ Products-test , where it says oboe love series,
The php.net page here http://www.php.net/manual/en/mysqlinfo.library.choosing.php says this Configure commands for using mysqlnd // Recommended,
This page says that GCC 4.5 has C++ raw string literals: http://gcc.gnu.org/projects/cxx0x.html But when
This adobe's page says that: In Flash Player, full-screen mode can only be initiated

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.