Previous Thread
Next Thread
Print Thread
Rate Thread
#315063 08/02/2007 4:04 PM
Joined: Jul 2007
Posts: 5
Lurker
Lurker
Offline
Joined: Jul 2007
Posts: 5
Could someone point me to where I can locate info for:

Quote
code edits to allow dynamic images


Vers 7.1.1

thanks!

Sponsored Links
TheDude #315065 08/02/2007 11:43 PM
Joined: Jun 2004
Posts: 4
Lurker
Lurker
Offline
Joined: Jun 2004
Posts: 4
I think we need something like this, updated for the latest version
https://www.ubbdev.com/forums/ubbthreads.php?ubb=showflat&Number=264598#Post264598

Going by that, I figure it's this code that needs to be changed
Code
                if( ($config['ALLOW_IMAGE_MARKUP'] && $type != "sig") || ( $config['IMAGE_MARKUP_IN_SIGS'] && $type == "sig" ) ) {
$regexes[] = array( "#\[img\]([^?\['\"]+?)\.(gif|png|jpg|jpeg)\[/img\]#i", '<img src="\1.\2" alt="" />' );
$regexes[] = array( "#\[image\]([^?\['\"]+?)\.(gif|png|jpg|jpeg)\[/image\]#i", '<img src="\1.\2" alt="" />' );
$regexes[] = array( "#\[img:(left|right|center)\]([^?\['\"]+?)\.(gif|png|jpg|jpeg)\[/img\]#i", '<img src="\2.\3" align="\1" alt="" />' );
$regexes[] = array( "#\[image:(left|right|center)\]([^?\['\"]+?)\.(gif|png|jpg|jpeg)\[/image\]#i", '<img src="\2.\3" align="\1" alt="" />' );


But I don't do regex so I have no idea.

If I remove the ? from
Code
[Linked Image from ]
then it will post as an image but won't show the correct text.

What do we have to change in that regex to allow the "?" ???
Or is it altogether somwhere else in the forum?

balamm #315066 08/02/2007 11:53 PM
Joined: Jan 2000
Posts: 5,834
Likes: 20
UBBDev Owner
Time Lord
UBBDev Owner
Time Lord
Joined: Jan 2000
Posts: 5,834
Likes: 20
Well, I believe this is "as is" due to security concerns; the system actively refuses images with ? or which don't match the file types; this is done so knobs can't just embed a so-called image which isn't an image (but instead a cleverly disguised script).

i however leave this thread to Ian or Rick when they get the chance to go more in-depth on the how's and why's.


UBBDev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.threads: My UBB Themes, My UBB Scripts
Gizmo #315069 08/03/2007 1:49 AM
Joined: Jun 2004
Posts: 4
Lurker
Lurker
Offline
Joined: Jun 2004
Posts: 4
Well that makes about as much sense as trying to stop someone viewing your html source or right clicking to save your images.
It can't be done so there's no sense worrying about it wink

The entire internet is dynamic and there's no way you're going to avoid "us knobs" trying to make it more usefull and interesting.

If you're that concerned about dynamic image scripts, or any interactive script, there's a simple solution.
Unplug your computer.

Anyway, thanks for your concern but we're not asking why the choice is lacking, only how to enable that choice thumbsup

balamm #315070 08/03/2007 2:05 AM
Joined: Jan 2000
Posts: 5,834
Likes: 20
UBBDev Owner
Time Lord
UBBDev Owner
Time Lord
Joined: Jan 2000
Posts: 5,834
Likes: 20
It's not those scripts, it's the kind that install mallitious software to your server and get your plug pulled for you by your host/datacenter...

When I said "knobs", I didn't mean you as a legitimate user, I meant some random fly by script which is scanning your webhost/subnet for "yet another target" that they can "own" for a botnet due to insecurities...


UBBDev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.threads: My UBB Themes, My UBB Scripts
Sponsored Links
Gizmo #315071 08/03/2007 2:08 AM
Joined: Jan 2000
Posts: 5,834
Likes: 20
UBBDev Owner
Time Lord
UBBDev Owner
Time Lord
Joined: Jan 2000
Posts: 5,834
Likes: 20
heres an example; I've seen some sites setting "gif" as a plaintext file, and link to it as an image; an example would be this one that i pulled from my log files (not an image in this instance):
http://www.the-esao.com/imag/stringa.txt

This type of "blocking" isn't out of the ordinary, check out all those which have plagued phpbb, one of which is this and several other "remote file inclusion" bugs.


UBBDev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.threads: My UBB Themes, My UBB Scripts
Gizmo #315072 08/03/2007 2:17 AM
Joined: Jan 2000
Posts: 5,834
Likes: 20
UBBDev Owner
Time Lord
UBBDev Owner
Time Lord
Joined: Jan 2000
Posts: 5,834
Likes: 20
btw, most gallery software now adays (which is what i'm assuming you're using) have a SE friendly urls option, which generally use PATH_INFO (like the UBB does) or mod_rewrite to create "virtual" directories, which would end up like:
image.php\text\sometext\ext.gif


UBBDev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.threads: My UBB Themes, My UBB Scripts
Gizmo #315073 08/03/2007 3:15 AM
Joined: Jun 2004
Posts: 4
Lurker
Lurker
Offline
Joined: Jun 2004
Posts: 4
Haven't had a problem with remote include attempts since switching to phpSuExec.

Yeah, I could recode to use htaccess and addtype as well but it's a pain. Either way, it's still a dynamic image.

phpbb was just a disaster waiting to happen. Only surprise is that it took so long to surface!

I don't see a problem with image code though as long as it's parsed as an image by the forum.
The worst that can happen is someone finds out what OS and plugins you're running. Opera and Mozilla based browsers return that info and more with a little javascript anyway and just about everyone's got urchin.js on their system now which I'd be a lot more concerned about wink

balamm #315085 08/05/2007 11:40 PM
Joined: Jun 2004
Posts: 4
Lurker
Lurker
Offline
Joined: Jun 2004
Posts: 4
Ok, we found the answer
change:
$regexes[] = array( "#\[img\]([^?\['"]+?)\.(php|gif|png|jpg|jpeg)\[/img\]#i", '' );
to:
$regexes[] = array( "#\[img\]([^\['"]+?)\.(php|gif|png|jpg|jpeg)\[/img\]#i", '' );
at line #1029 of ubbthreads.inc.php

Same for any other regexes that disallow dynamic tags.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,575
Posts293,931
Members13,823
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Gizmo 1
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)