close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Security: default value for text recordset parameter

Thread began 2/03/2016 1:54 am by Sweens | Last modified 2/03/2016 11:19 am by Ray Borduin | 1180 views | 6 replies |

Sweens

Security: default value for text recordset parameter

Hi

I'm after a bit of advice, if someone can help. I'm moving away from integer parameters in recordsets (e.g. where id = 1) to text values, as I'm trying to use friendly urls.

So a recordset might have where pg_slug = $_GET['slug']. All this works and the correct page is returned, but I'm really wanting to know if there is a potential security risk here, as I have the default value as 'hjgubjvyu64565dx' (or similar random guff). Should the default text value be % or something else - or does it not matter?

Many thanks

Chris

Sign in to reply to this post

Ray BorduinWebAssist

I'm not sure what code you are using exactly, so I can't comment on a security risk. That default value will presumably not return any results, so there is no security risk in that particular aspect.

Sign in to reply to this post
Did this help? Tips are appreciated...

Sweens

Thanks Ray

I'm using variants on:

<?php
$rsPageMenu = new WA_MySQLi_RS("rsPageMenu",$connSite_i,0);
$rsPageMenu->setQuery("SELECT `pages`.`PgID`, `pages`.`PgTitle`, `pages`.`SiteID`, `pages`.`PgDesc`, `pages`.`MemOnly`, `pages`.`pg_url`, `sites`.`short_url`, pages.PgMainPic, pages.PgMainPicAltText FROM `pages` Inner Join `sites` ON `sites`.`SiteID` = `pages`.`SiteID` WHERE `sites`.`short_url`=? AND pages.UnderPag_PgID = 0 AND pages.PgTypeID=1 AND (pages.DisplayUntil IS NULL OR pages.DisplayUntil = '') ORDER BY pages.PgSortOrder ");
$rsPageMenu->bindParam("s", "".$_GET['su'] ."", "jhg ytokjiyr22t8cxfdxsfg"); //p1
$rsPageMenu->execute();
?>

it's the value 'jhg ytokjiyr22t8cxfdxsfg' I'm not sure of

Cheers
Chris

Sign in to reply to this post

Ray BorduinWebAssist

There is no security issue in using that value. I usually just use "-1" since presumably you would never have that as the short_url, but really any value that you are sure will never be in that column will work.

Sign in to reply to this post
Did this help? Tips are appreciated...

Sweens

Many thanks Ray. I assume that where I want the default value to be a 'real' short_url, there is no security implication?

Cheers
Chris

Sign in to reply to this post

Ray BorduinWebAssist

Nope that would be fine too... it would just mean that page would show up if the page was visited directly.

Sign in to reply to this post
Did this help? Tips are appreciated...

Sweens

Thanks for your help Ray - very reassuring!

Cheers
Chris

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...