Waraxe IT Security Portal
Login or Register
November 2, 2026
Menu
Home
Logout
Discussions
Forums
Members List
IRC chat
Tools
Base64 coder
MD5 hash
CRC32 checksum
ROT13 coder
SHA-1 hash
URL-decoder
Sql Char Encoder
Affiliates
y3dips ITsec
Md5 Cracker
User Manuals
AlbumNow
Content
Content
Sections
FAQ
Top
Info
Feedback
Recommend Us
Search
Journal
Your Account
User Info
Welcome, Anonymous
Nickname
Password
(Register)

Membership:
Latest: MichaelSnaRe
New Today: 0
New Yesterday: 0
Overall: 9144

People Online:
Visitors: 205
Members: 0
Total: 205
Full disclosure
Apache Struts2 Core Arbitrary Code Execution via OGNL SandboxEscape
Apache Struts2 Core TokenHelper Token Cryptographic Timing Side-Channel
Apache Struts2 Spring Plugin Uses a Previously Closed Resource
Apache Struts2 Core Integer Overflow
Apache Struts2 Core Cross-Origin Protection Exemption Miskeyed to a Deployment-Wide Path
Apache Struts2 REST Plugin Fails to Properly Parse ChunkedRequests
Apache Struts2 REST Plugin Untrimmed `Accept` Header Tokens Break Content Negation Fallback
Apache Struts2 JSON Plugin Insecure Deserialisation -- Object Deserialisation Element-Count Limit Bypass
[0day-rubbish] NETGEAR RAX120 V1.2.5.18 authenticated SOAP InstallApp OS command injection to root-configured web-stack execution (6.8 Medium; conditionally 7.2 High with management exposure)
[0day-rubbish] Raritan PX3 PDU G4 firmware 4.3.14 command injection in the ping and traceroute diagnostics through an inverted hostname-validation return check (8.8)
[0day-rubbish] NUUO Crystal Server 3.19.0.85 unauthenticated upload.php PHP web-root write with fastcgi execution into server-side code execution as the web service account (9.8 Critical)
[0day-rubbish] Moxa MAR-2000 firmware FWR_MAR2000_V1.0_Build_15 010909 scenario ping condition command injection through the auto-executing ping thread (7.2)
[0day-rubbish] Moxa MAR-2000 firmware FWR_MAR2000_V1.0_Build_15 010909 IPsec tunnel address command injection through the route-management shell commands (7.2)
[0day-rubbish] Moxa MAR-2000 firmware FWR_MAR2000_V1.0_Build_15 010909 command injection in the Executer program activation path (7.2)
Re: CVE-2026-109618: PHP-CGI Pointer Underflow ? Remote Code Execution (CVSS 9.2)
Log in Register Forum FAQ Memberlist Search
IT Security and Insecurity Portal

www.waraxe.us Forum Index -> Php -> Link in forum
Post new topicReply to topic View previous topic :: View next topic
Link in forum
PostPosted: Sun Jan 13, 2008 9:54 am Reply with quote
shmk
Active user
Active user
Joined: Jul 22, 2004
Posts: 25




What's the most secure PHP filter that allow users to insert links to sites or images in a forum without flaws in security? (regarding xss and csrf overall)
View user's profile Send private message
PostPosted: Sun Jan 13, 2008 12:23 pm Reply with quote
waraxe
Site admin
Site admin
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




It's always possible to fool the security filters. Attacker can first place normal picture to remote server and then post img link to it. This will pass all security tests and posting will be allowed. After that attacker just changes original image on remote server with anything else he wants. Attacker can use Amapche's mod_rewrite, so that (victim) client browser will ask for jpg and will get 301/302 redirect pointing somewhere - classical CSRF case through GET method. I have seen more paranoid solutions, where webserver will check remote image validity within ANY request, and even this will not help, because image hosting server can serve different content based on client IP - so that checking webserver will see this as normal image, but subsequent victim browser will get mailicious CSRF redirection.
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Sun Jan 13, 2008 1:42 pm Reply with quote
shmk
Active user
Active user
Joined: Jul 22, 2004
Posts: 25




waraxe wrote:
It's always possible to fool the security filters. Attacker can first place normal picture to remote server and then post img link to it. This will pass all security tests and posting will be allowed. After that attacker just changes original image on remote server with anything else he wants. Attacker can use Amapche's mod_rewrite, so that (victim) client browser will ask for jpg and will get 301/302 redirect pointing somewhere - classical CSRF case through GET method. I have seen more paranoid solutions, where webserver will check remote image validity within ANY request, and even this will not help, because image hosting server can serve different content based on client IP - so that checking webserver will see this as normal image, but subsequent victim browser will get mailicious CSRF redirection.


So the only secure system is disable external links?
And a "quite" secure system? Rolling Eyes

The classical hidden token system could limit the CSRF or it's quite useless? (i saw it mainly in POST form but it could be used in GET too?)
View user's profile Send private message
PostPosted: Sun Jan 13, 2008 2:33 pm Reply with quote
waraxe
Site admin
Site admin
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




Anti-CSRF measures with random token or even with CAPTCHA (for critical requests) are very effective by my personal experience. So if you have securely written code with no potential CSRF threats, then linking remote images is not big security risk. But you must be sure about XSS too, because if there is XSS possibilities, then hidden token protection can be bypassed - because attacker can read token values right from html source or even submit POST forms without user interaction. Most secure anti-csrf still is CAPTCHA - critical operations, like new admin account creation, password change, file deletion - these are the situations, where CAPTCHA is useful.
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Sun Jan 13, 2008 3:02 pm Reply with quote
shmk
Active user
Active user
Joined: Jul 22, 2004
Posts: 25




waraxe wrote:
Anti-CSRF measures with random token or even with CAPTCHA (for critical requests) are very effective by my personal experience. So if you have securely written code with no potential CSRF threats, then linking remote images is not big security risk. But you must be sure about XSS too, because if there is XSS possibilities, then hidden token protection can be bypassed - because attacker can read token values right from html source or even submit POST forms without user interaction. Most secure anti-csrf still is CAPTCHA - critical operations, like new admin account creation, password change, file deletion - these are the situations, where CAPTCHA is useful.


Many thanks, so a token + capthca and maybe a verification email could block CSRF.

Now I need to analyze the BIG XSS problem Razz
At this time I have only a htmlentities(strip_tags(),ENT_QUOTES)
View user's profile Send private message
PostPosted: Mon Jan 14, 2008 9:51 pm Reply with quote
shmk
Active user
Active user
Joined: Jul 22, 2004
Posts: 25




waraxe wrote:
Attacker can first place normal picture to remote server and then post img link to it. This will pass all security tests and posting will be allowed. After that attacker just changes original image on remote server with anything else he wants.


With this stratagem every forum security could be bypassed? Yours PHPBB too? Very Happy
View user's profile Send private message
PostPosted: Mon Jan 14, 2008 11:08 pm Reply with quote
waraxe
Site admin
Site admin
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




Yes - in this forum remote images are allowed in postings so that CSRF possibilities are real.

Still - remote image can forge only GET request, and as much as i know and i have looked at phpbb source, most of the operations in user and admin control panel are based on POST method. So potential security impact is low here.

Bottom line - use POST as much as possible in any critical operations. This will cripple image-based CSRF attacks ... Smile
View user's profile Send private message Send e-mail Visit poster's website
Link in forum
www.waraxe.us Forum Index -> Php
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT
Page 1 of 1

Post new topicReply to topic


Powered by phpBB © 2001-2008 phpBB Group



PCWizardHub - Helping you fix, build, and optimize your PC life
All logos and trademarks in this site are property of their respective owner. The comments and posts are property of their posters, all the rest (c) 2004-2024 Janek Vind "waraxe"
Page Generation: 0.060 Seconds