为什么realurl在没有cHash的情况下保存链接?

时间:2017-02-20 11:07:07

标签: typo3 realurl

realurl 会在没有cHash的表tx_realurl_urldata链接中保存。如果黑客在URL中添加了一些get参数,那么DB-flooding就成为可能:

L=1&id=14&tx_gbaccount_transactions[@widget_0][currentPage]=3&foo=bar L=1&id=14&tx_gbaccount_transactions[@widget_0][currentPage]=3&asd=123

这个问题有解决方案吗?我可以说 realurl ,不保存某些链接吗?

感谢' S

3 个答案:

答案 0 :(得分:2)

您可以排除某些参数被缓存。

参考2.x手册:https://github.com/dmitryd/typo3-realurl/wiki/Notes-for-Developers#banning-certain-urls-from-realurl-cache

请注意,2016年9月之前TYPO3核心存在问题已修复:https://typo3.org/teams/security/security-bulletins/typo3-core/typo3-core-sa-2016-022/

据我所知,无法通过添加随机参数来泛滥realurl缓存。如果您找到方法,请在Dmitrys github项目中创建错误报告:https://github.com/dmitryd/typo3-realurl

答案 1 :(得分:0)

只有在使用TYPO3 typolink功能创建链接时才会写入realurl的缓存条目。它们不是基于外部请求创建的。因此,泛洪此缓存的唯一方法是自己通过脚本来完成。

缓存条目可以包含cHash,也可以不包含cHash,具体取决于创建链接所使用的typolink参数。 因此,您可以通过设置useCacheHash = FALSE告诉typolink不要使用它来明确禁用cHash使用。

事实上,这是通过大多数插件和插件API方法完成的,以防全局禁用缓存,或者在USER_INT对象的上下文中创建链接,其中仅为此上下文禁用缓存。 在这种情况下,不期望缓存,因此通常不需要cHash。

答案 2 :(得分:0)

我认为,分页小部件写得不太正确。 分页小部件使用具有方法getWidgetUri

的小部件LinkViewHelper
p <- style(p = last_plot(), traces = c(1,2,3,4), showlegend = FALSE)

setAddQueryString(true)表示将所有get-parameter添加到每个分页URL 并且不可能将addQueryString设置为false,或者说只需要添加某些参数。就我而言,这些是startdate和enddate

我使用xclass解决了这个问题,getWidgetUri看起来像这样:

require(ggplot2)
require(plotly)
set.seed(1)

pl <- lapply(1:3, function(.x) ggplot(data.frame(x=rnorm(100),y=rnorm(100),group=c(rep("a",50),rep("b",50))),aes(x=x,y=y,col=group))+geom_point())
p <- lapply(pl,function(p) ggplotly(p))
p[[1]][['x']][['data']][[1]][['showlegend']] <- FALSE
p[[1]][['x']][['data']][[2]][['showlegend']] <- FALSE
p[[2]][['x']][['data']][[1]][['showlegend']] <- FALSE
p[[2]][['x']][['data']][[2]][['showlegend']] <- FALSE
#clears the 'group' annotation
p[[1]][['x']][['layout']][['annotations']][[1]][['text']] <- ''
p[[2]][['x']][['layout']][['annotations']][[1]][['text']] <- ''

htmlwidgets::saveWidget(subplot(p),"pl.html")