Commit Graph
3709 Commits
Author SHA1 Message Date
Jeferson Araujo ad9904a35d Clarify the feed content selector in Brazilian Portuguese (#9670)
Clarify the content retrieval settings in Brazilian Portuguese. The current label asks for a CSS path, which can suggest a stylesheet location. The setting expects a selector such as `.entry-content`. The help text now explains that FreshRSS fetches article content from the original site when the RSS feed provides only part of the text.
2026-12-01 16:41:28 +01:00
0abfe20385 Fix: corriger les statistiques PostgreSQL (#9659)
Closes #9658

Changes proposed in this pull request:

- Use PostgreSQL `dow` instead of `day` for the day-of-week chart.
- Normalize month repartitions to exactly 12 entries, from January to December.
- Include today in the 30-day chart, anchor the day calculation on the oldest timestamp so integer division is always positive, and return a JSON list.
- Set chart labels and build the average line as an array matching the bar data.

* Fix: corriger les statistiques PostgreSQL

* Remove dead code

---------

Co-authored-by: upskaling <upskaling@users.noreply.github.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-30 20:35:11 +01:00
fuyoacademy cb522a8dbf Keep the errors filter after removing a feed (#9656)
Fix #9654

When the subscription page shows only the feeds with errors and a feed is removed from its slider, the redirect went back to the full list. The remove button now keeps `error=1`, and `feed/delete` redirects to the subscription page with `error=1` in that case.

Without `error`, the redirect is unchanged.

How this was checked: I ran FreshRSS 1.31 edge with the PHP built-in server and SQLite, with one feed in error. Before the change, `POST feed/delete` from the error-filtered slider redirected to `?c=subscription`. After the change, it redirects to `?c=subscription&error=1`. Without the error filter, it still redirects to `?c=subscription`. I did not add a PHPUnit test because the action ends in a redirect, and I did not run `make test-all`.
2026-11-30 11:06:59 +01:00
Jeferson Araujo a93c864b99 Translate three remaining Brazilian Portuguese catalog strings (#9657)
Translate the remaining English text for user-query sorting, the pending WebSub notification, and the existing password length message. These keys are separate from #9655.
2026-11-30 10:15:54 +01:00
Jeferson Araujo 3da447ae66 Translate reading actions into Brazilian Portuguese (#9655) 2026-11-29 21:43:17 +01:00
InverleandAlexandre Alapetite feeec153c4 Normalize cURL proxy options during requests (#9604)
Ref: [GHSA-fc32-79hf-pcmw](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-fc32-79hf-pcmw) (considered a bug), https://github.com/curl/curl/issues/23681, https://github.com/FreshRSS/FreshRSS/discussions/9286#discussioncomment-18392518

Fixed issues:
* Using wrong default HTTP port for proxies (supposed to be 1080 not 80).
* Lack of system configuration support for a mix of `CURLOPT_{PROXY,PROXYTYPE,PROXYPORT}` options, along with user defined feed options.

* Normalize cURL proxy options during requests

* Use `CURLPROXY_HTTPS` in tests instead of 2

* Fix some more mismatched port cases

* Remove changelog
Avoid changelog in PRs to reduce conflicts

* Minor comments reduction

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-29 17:39:25 +01:00
Alexandre Alapetite ec7c07b17d Fix charset Windows-1252 (#9649)
fix https://github.com/FreshRSS/FreshRSS/issues/9648
2026-11-28 18:06:00 +01:00
Inverle db2cc4a373 Ease keyboard navigation within article contents (#9643)
* After uncollapsing an article, the first element inside of it will be focused (the title link) for easier Tab navigation.
* All of the links inside entry headers (normal view) now use `tabindex="-1"`, so they can't be focused anymore using Tab. This makes navigation less confusing as there is JS functionality already for moving between articles (i.e. j/k keys) which is the intended way.
  * (or s/l for the Share or Labels menu)
* Focus rings are now visible again (removed `outline: none` from CSS for `<a>` elements).

This is mainly for the Normal view, but affects the Reader and Global views too.
2026-11-28 16:06:10 +01:00
Meer KhurramandMeer Khurram 82e6fabdd9 Add Hindi (hi) translation (#9645)
Adds a complete Hindi translation in app/i18n/hi/ (all 1,180 strings of the English files, plus plurals.php with nplurals=2; plural=(n > 1)), registers hi in the gen.lang list of every language, and updates the translation table in README.md and README.fr.md.

Co-authored-by: Meer Khurram <199657909+imeerkhurram@users.noreply.github.com>
2026-11-28 12:59:03 +01:00
CokeRoach 5a58b22361 i18n: complete Korean (ko) translations (#9640)
The Korean translation had 228 entries marked // TODO (falling back to English)
and 14 marked // DIRTY across 9 files. This translates the TODO entries, updates
the DIRTY ones to the current English, and marks three strings that stay the
same in Korean as // IGNORE (the "❌ " error prefix, "Lietuvių" and "URL").
Korean is now at 100% in the README tables.
2026-11-28 01:45:15 +01:00
yztutuandAlexandre Alapetite cc9f03e654 i18n: complete Simplified Chinese (zh-CN) translations (#9633)
* i18n: complete Simplified Chinese translations

* make fix-all

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-26 17:25:41 +01:00
yztutuandAlexandre Alapetite 267828735e i18n: complete Traditional Chinese (zh-TW) translations (#9634)
* i18n: complete Traditional Chinese translations

* make fix-all

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-26 17:21:46 +01:00
f94c101621 Harden SSRF guard: reject remaining reserved/special-use IP ranges (#9621)
* Reject remaining special-use ranges in the SSRF guard

FILTER_FLAG_GLOBAL_RANGE still accepts several reserved ranges on
supported PHP versions. Reject those explicitly, including when an
IPv4 address is embedded in the public NAT64 prefix, and keep
legitimate public NAT64 addresses allowed.

Co-authored-by: aplaton216 <aplaton216@users.noreply.github.com>

* Refactor

Fix https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-2983-h3r5-qv6j
Fix https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-8f2g-vq96-ffxw

* Doc PHP upstream

https://github.com/php/php-src/pull/25426

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: aplaton216 <aplaton216@users.noreply.github.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-25 15:20:34 +01:00
Alexandre Alapetite 5d81cd8832 Avoid duplicated enclosure titles (#9615)
Fix https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-pwpq-78jm-px4m
2026-11-24 09:14:10 +01:00
Alexandre Alapetite dcd40cb7d4 Better sanitize domains (#9611)
Fix https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-3ch8-46c3-xr9h
2026-11-22 21:57:54 +01:00
Alexandre Alapetite 6320ff8af7 More secure remove access (#9610)
Fix https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-r27w-hr3c-hjr3
2026-11-22 21:54:39 +01:00
Chareonwit KunnaandAlexandre Alapetite cf6a0a5c35 docs: fix doubled words (#9609)
* docs: fix doubled word

Signed-off-by: Chareonwit Kunna <21arenabreakout12@gmail.com>

* docs: fix doubled word

Signed-off-by: Chareonwit Kunna <21arenabreakout12@gmail.com>

* docs: fix doubled word

Signed-off-by: Chareonwit Kunna <21arenabreakout12@gmail.com>

* docs: fix doubled word

Signed-off-by: Chareonwit Kunna <21arenabreakout12@gmail.com>

* One more

---------

Signed-off-by: Chareonwit Kunna <21arenabreakout12@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-22 13:20:56 +01:00
Inverle 6a6b23bf82 Fix HTML injection in extension names (#9608)
Fix [GHSA-crc7-3qcq-m9h3](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-crc7-3qcq-m9h3)
2026-11-22 08:54:32 +01:00
Alexandre Alapetite 2855de21e3 Fix full-content logic (#9602)
Rewritten inspired by MIME multipart boundaries.
Fix https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-5hcv-wqwr-j8r8
2026-11-21 22:39:13 +01:00
Alexandre Alapetite 67cb0a2d9a Sanitize DB install params (#9595) 2026-11-20 22:41:26 +01:00
Inverle 2f31a2fdf5 Fix HTML injection in view mode error notification (#9605)
Fix [GHSA-wpf6-5v7v-6cvj](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-wpf6-5v7v-6cvj)

Introduced in https://github.com/FreshRSS/FreshRSS/pull/7668
2026-11-20 22:11:25 +01:00
Alexandre Alapetite 8ffddc11f8 More security for extension files: nosniff (#9593)
Global `X-Content-Type-Options: nosniff`
And follow-up of #7753
2026-11-20 13:54:09 +01:00
Alexandre Alapetite 13280a4dfc Safer login (#9592)
Avoid using some functions changing state before full verification.
Related to https://github.com/FreshRSS/FreshRSS/pull/9598
2026-11-20 10:24:29 +01:00
Inverle 2584514db3 Deny formLogin access if already logged in (#9598)
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/9592

There is no reason for logged in users to have access to the login page.
2026-11-20 08:10:27 +01:00
Alexandre Alapetite ae664c8ccd Better sanitize bookmark (#9594) 2026-11-19 23:20:55 +01:00
Alexandre Alapetite ea646d2bde Use PHP 8.4+ \Dom classes and functions (#9567)
Currently, SimplePie uses legacy DOMDocument parsing, which outputs potentially problematic HTML, not correctly sanitised.
This breaks the assumption that one can use something like `<div><!-- some HTML sanitized from SimplePie --></div>`.

```
--- Expected
+++ Actual
@@ @@
 '<ul>
-    <li><div></div></li>
+    <li><div>
     <li>Item</li>
-</ul>'
+</div></li></ul>'
```

When shown in a compliant Web browser, several tags will be wrongly closed, breaking the layout of the client.

This PR patches SimplePie to use the modern parser and code syntax, while maintaining a best-effort polyfill for legacy PHP versions < 8.4.

Depends on:

SimplePie: Upgrade to PHPStan 2
* https://github.com/FreshRSS/simplepie/pull/97
* https://github.com/simplepie/simplepie/pull/939
* https://github.com/simplepie/simplepie/pull/1019

SimplePie: Use PHP 8.4+ \Dom classes and functions
* https://github.com/FreshRSS/simplepie/pull/98
* https://github.com/simplepie/simplepie/issues/1021

SimplePie: Add unit test for HTML5 sanitizing compliance
* https://github.com/simplepie/simplepie/pull/1022

SimplePie: Remove obsolete xml_is_sane and XMLReader fallback
* https://github.com/simplepie/simplepie/pull/1023

CssXPath: Add support for case insensitivity
* https://github.com/phpgt/CssXPath/pull/256

fix https://github.com/FreshRSS/FreshRSS/issues/5201
fix https://github.com/FreshRSS/FreshRSS/issues/6830
fix https://github.com/FreshRSS/FreshRSS/issues/6831

~5% faster for HTML sanitising.
Remove SimpleXML. Remove XMLReader.
2026-11-19 23:17:04 +01:00
Alexandre Alapetite 289a00be00 A few misc. security enhancements (#9591) 2026-11-19 20:09:02 +01:00
Alexandre Alapetite 6aeca31312 Add Cross-Origin-Opener-Policy (COOP) header (#9588)
https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cross-Origin-Opener-Policy
2026-11-19 20:08:21 +01:00
IEEE-754 3c36d36b48 i18n: Improve Traditional Chinese translations (#9590)
- Refine wording
- Add some new translations
2026-11-19 16:21:43 +01:00
Ricardo SimõesandAlexandre Alapetite c4a4924529 Update conf.php - European Portuguese pt-PT translation (#9583)
* Update conf.php - European Portuguese pt-PT translation

Translated just 1 string at line 314

* make fix-all

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-18 15:23:56 +01:00
d6c907bc04 SQLite, PostgreSQL: batch markRead for lists of IDs (#9575)
Closes #9574

Changes proposed in this pull request:

- `FreshRSS_EntryDAOSQLite::markRead()` now passes arrays of IDs to `FreshRSS_EntryDAO::markRead()`. That method already does a batched `UPDATE … WHERE is_read<>? AND id IN (…)`, split into chunks by `MAX_VARIABLE_NUMBER` (998, which also covers SQLite's parameter limit), then refreshes the unread caches once. For lists of fewer than 6 IDs it still calls back into the existing per-entry SQLite/PostgreSQL path. `FreshRSS_EntryDAOPGSQL` inherits the change.
- The `@param` type now matches the parent's `list<numeric-string>` (PHPStan `argument.type`).

How to test the feature manually:

1. Use PostgreSQL with some latency (`tc qdisc add dev eth0 root netem delay 25ms` on the database host gave about 75 ms per round trip).
2. Mark several hundred unread articles read in a single Google Reader API `edit-tag` request, or call `FreshRSS_Factory::createEntryDao()->markRead($ids, true)` from a CLI script.
3. Compare elapsed time and check that `SUM(cache_nbUnreads)` still equals the unread count in `_entry`.

My results (official `edge` image; the DAO files are identical in 1.30.4):

| Backend | Case | Before | After |
|---|---|---|---|
| PostgreSQL 17, ~75 ms RTT | mark 300 read | 60.5 s | 0.16 s |
| PostgreSQL 17, ~75 ms RTT | resend the same 300 (no change) | 37.6 s | 0.08 s |
| PostgreSQL 17, ~75 ms RTT | mark 2,500 read / unread (chunked) | not run | 0.49 s / 0.49 s |
| SQLite | mark 300 read | 1.48 s | 0.01 s |
| SQLite | mark 2,500 read / unread (chunked) | not run | 0.04 s / 0.04 s |

Unread caches matched the entry table in every case, including lists under 6 IDs and mark-unread. A production instance (PostgreSQL about 100 ms away) has been running the PostgreSQL variant of this change. Reeder on iOS, which had been timing out on every sync, now syncs normally, and `edit-tag` requests finish in under a second.

* SQLite, PostgreSQL: batch markRead for lists of IDs

FreshRSS_EntryDAOSQLite::markRead() handled an array of IDs one entry
per transaction, and FreshRSS_EntryDAOPGSQL inherits it. Delegate
arrays to FreshRSS_EntryDAO::markRead(), whose batched
UPDATE ... WHERE is_read<>? AND id IN (...) is portable, is chunked by
MAX_VARIABLE_NUMBER, and calls back into the per-entry path for small
lists.

Fix https://github.com/FreshRSS/FreshRSS/issues/9574

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Reduce comments

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-17 09:28:55 +01:00
Ricardo Simões d614912f3c Update pt-PT translation (#9573)
Updates European Portuguese pt-PT translation
2026-11-17 08:15:12 +01:00
Corey QuinnandAlexandre Alapetite e7fe44bf86 PostgreSQL: detect FreshRSS tables by visibility rather than owner (#9535)
* PostgreSQL: the owner was never the story, so stop asking who owns the tables

For as long as the install check has existed, it asked pg_tables who owned
the tables and compared that against the database login. Nobody asked why.
The login is a gateway user, the tables belong to whatever role ran the
install, and whenever those two names diverged the check reported the schema
as missing. Visibility was the question all along.

tablesAreCorrect() now asks pg_class which ordinary and partitioned tables
are visible on the search_path. If PostgreSQL can see it, it counts. A table
parked in a schema outside the path does not hide a missing one, and a view
named like a table is not a table.

The new test builds a role, a visible schema, a hidden schema, and a view
with a suspicious name, then checks that each answer is the true one. It runs
against a real PostgreSQL 18 service in CI. Locally it skips unless
FRESHRSS_TEST_PGSQL_DSN is set.

* Pin the CI Postgres service to a digest, because somebody moved the tag

For the record: nobody announced it. The postgres:18-alpine tag sat in
tests.yml like a loaded gun pointed at every CI run, and zizmor was the
first thing to notice it had no fixed identity at all. Remember the
Denver Airport. Remember that tags are not promises.

This commit replaces the mutable tag with the exact multi-arch digest the
suite was already tested against:

  postgres:18-alpine@sha256:eaef288f54a90a909e49f0121d5d047a5e974e922699de4249625cf7cde34f36

This is not a version bump. Same image, same PostgreSQL 18, same Alpine
base. The only thing that changed is that the image can no longer be
swapped out from under us between Tuesday's green run and Thursday's
mystery failure.

Verification: all pre-commit PHP, test, JS, CSS and Markdown checks pass.
Local pedantic offline zizmor reports no findings. This resolves the
unpinned-service-image blocker on PR #9535.

* Rewrite test a bit

* Fix make test-all

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-16 23:26:18 +01:00
Inverle 77e74e81b7 Serve consistent error responses on failed logins (#9568)
Fixes #4095

Follow-up of #9566

Although no separate error message for disabled users yet (will be done in another PR).
2026-11-16 22:38:25 +01:00
Inverle 06c0329de2 Fix wrong status code on failed login (#9566)
Regression from https://github.com/FreshRSS/FreshRSS/pull/9358 (PR not present in current release, stopped sending 403 on failed logins).

This PR fixes the Minz bug mentioned in https://github.com/FreshRSS/FreshRSS/pull/9358#discussion_r4382254359 which occurred with `redirect: false` redirects.

But it also takes a different approach for redirecting, by using HTML instead of the `Location` header (to address one additional issue with a resubmit prompt appearing when refreshing the login page after a failed login).

403 is now returned during failed reauthentication as well.
2026-11-15 23:34:53 +01:00
Artem Netsvetaev 62c47b7168 Fix lookup of the localised default category (#9543)
The GReader API exposes a translated default category name while the database stores Uncategorized. Resolve that name by the constant category ID so marking the category as read accepts the label returned by the API.

Add SQLite regression coverage for English, Russian and French, ordinary Cyrillic category names with spaces, and missing categories.

Fixes #9542
2026-11-14 22:31:20 +01:00
d1fe6e694d Add option to open articles on their original website (#9554)
* Add option to open articles on their original website

Clicking an article title can now open the original website instead of the article in FreshRSS. The link icon then opens the article in FreshRSS.

fix https://github.com/FreshRSS/FreshRSS/issues/1954

* i18n: fr

---------

Co-authored-by: Eduardo Coronell <eduardo.coronell@aspsols.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-14 22:30:32 +01:00
Alexandre Alapetite e66fa341a0 Better catch and log user regex errors (#9559)
To get a chance to find out where they come from:

New log:
```
[Thu, 12 Nov 2026 15:28:27 +0000] [warning] --- FreshRSS_Entry::regexMatch Invalid PCRE regex `/\q/`; preg_match(): Compilation failed: unrecognized character follows \ at offset 1; in search: `intitle:/\q/ author:Alice`; first triggered by entry 1731000000123456 of feed 123
```

instead of:
```
PHP Warning:  preg_match(): Compilation failed: unrecognized character follows \ at offset 1 in /var/www/FreshRSS/app/Models/Entry.php on line 875
```
2026-11-14 21:46:31 +01:00
Carl df1953f8d3 Load theme icons in views rendered without layout (#9564)
The theme was only loaded by the layout, so AJAX-loaded views such as the feed and category settings panels fell back to the default icons.
2026-11-14 11:10:28 +01:00
Jay HemnaniandAlexandre Alapetite 2ce6f1125b fix: do not double-encode titles and authors when importing JSON (#9556)
* fix: do not double-encode titles and authors when importing JSON

FreshRSS exports titles and authors HTML-encoded, and the JSON import
encoded them again since #9168, so restoring a ZIP export turned
"Post &amp; more" into "Post &amp;amp; more". Decode before encoding.

* Unit test

* Reduce comments

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-12 17:39:51 +01:00
Alexandre Alapetite 02aaa56aca Fix OPML import of numeric-string category names (#9552)
fix https://github.com/FreshRSS/FreshRSS/issues/9551
`array_merge()` changes the key value of numeric-string keys
2026-11-11 21:43:25 +01:00
CaoMeiYouRenandAlexandre Alapetite 8e281292f9 RSS: emit <enclosure> for BitTorrent attachments (#9553)
* feat: add the <enclosure/> field to enhance compatibility with BitTorrent downloaders

Closes #6227

Changes proposed in this pull request:

- Emit an additional RSS 2.0 `<enclosure>` element for BitTorrent attachments in the
  generated RSS output (`p/api/query.php?...&f=rss` and the per-feed RSS view).
  The existing `<media:content>` output is unchanged.
- Emit it only for `application/x-bittorrent`, `magnet:` and `.torrent` URLs, and skip
  images / audio / video. Since 1.24 thumbnails are prepended to the enclosure list, a
  naive implementation would duplicate cover images (and podcast media) as attachments.
- Always set `type="application/x-bittorrent"`, and copy `length` when the feed provides it.
- Add unit tests in `tests/app/Views/rssViewTest.php`: torrent, magnet without type,
  image attachment skipped.

* fix(rss): emit <enclosure> only for BitTorrent attachments

The previous patch emitted <enclosure> for every enclosure. Since FreshRSS
1.24, thumbnails are prepended to the enclosures list, so cover images and
podcast audio were also duplicated as RSS attachments. Emit the tag only for
application/x-bittorrent, magnet: or .torrent URLs, and always set
type="application/x-bittorrent" so clients such as qBittorrent can use it.

Add three rssViewTest cases: torrent, magnet without type, image skipped.

* Improve regex

* Minor whitespace

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-11 21:02:30 +01:00
InverleandAlexandre Alapetite 6af8ebcbff Fix current password requirement during password changes (#9550)
* Fix current password requirement during password changes

Regression from #9358 (follow-up, PR not present in a stable/versioned release)

Fix [GHSA-5vxm-62pg-frff](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-5vxm-62pg-frff)

* Remove stale client side bcrypt comment from passwordUtil

* docs: PHP 8.1 is no longer supported

* Minor typographic preference

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-10 01:13:52 +01:00
Mehmet 27c2b18822 Shared queries: keep user search in HTML pagination (#9545)
Fix the paging bug noticed in #9544.

In the HTML view of a shared user query, the pagination links did not include the `search` parameter, so the user search was lost when going to the next page.

The pagination links now keep the user search (URL-encoded). The common part of the URLs is factored out, using `&amp;` consistently.

Tested locally with a shared query of 60 entries and `search=x`: the second page now only shows matching entries.
2026-11-09 08:47:37 +01:00
6d7417ad8b Validate CURLOPT_PROXY format in sanitizeCurlParams() (#9537)
* Validate CURLOPT_PROXY format to prevent SSRF allowlist bypass

sanitizeCurlParams() previously only whitelisted cURL option keys and
never validated the CURLOPT_PROXY value itself. httpGet() and the
SimplePie File constructor both strip a scheme from the proxy string
with a greedy preg_replace('#^.*://#', '', $proxy) before running the
host through the internal-host allowlist / DNS-pinning check, but the
*original*, unstripped value is what actually gets handed to cURL.

A proxy value containing a second "://", e.g.
http://127.0.0.1:8080/://8.8.8.8, is reduced by the greedy strip to
the trailing "decoy" host (8.8.8.8) for the allowlist check, while
cURL still connects using the full original string. Depending on how
the installed libcurl parses it, this can route the request to
127.0.0.1:8080 instead of the validated public address.

This adds isSafeProxyString(), a strict format check for
[scheme://][user[:pass]@]host[:port] with no extra path, query,
fragment, or embedded scheme separator, and rejects CURLOPT_PROXY in
sanitizeCurlParams() when it doesn't match. Since every per-feed and
OPML-imported curl_params array is routed through sanitizeCurlParams()
before use (Feed.php, SimplePieCustom.php, ImportService.php), this
single chokepoint covers both the httpGet() and SimplePie fetch paths.

Added regression tests in httpUtilTest.php covering the exploit
payload and a range of legitimate proxy strings (bare host:port,
scheme-prefixed, SOCKS5 with credentials, SOCKS5h host-only).

* Normalise CURLOPT_PROXY scheme once, centrally; drop redundant downstream strips

Per review feedback: now that sanitizeCurlParams() validates CURLOPT_PROXY
and guarantees at most one scheme separator, it also strips that (validated)
scheme once, so the value stored is always scheme-less. This removes the
need for httpGet() and the bundled SimplePie File::curlInit() to each
re-strip the scheme themselves -- both call sites are updated to rely on
the value already being normalised.

Updated the regression tests to assert the normalised value, not just
whether the key survives sanitization.

* Disallow a scheme in CURLOPT_PROXY entirely, per review

CURLOPT_PROXYTYPE is what tells cURL the proxy's scheme -- CURLOPT_PROXY
itself was never supposed to carry one. Rather than validating-then-
stripping a scheme, sanitizeCurlParams() now rejects any CURLOPT_PROXY
value that contains one at all, simplifying isSafeProxyString() and
removing the normalisation step (and its own small regex) entirely.

Trimmed the accompanying comment to the one load-bearing line, and
updated the stale 'strips the scheme' wording in httpGet() and the
SimplePie File::curlInit() comment to 'rejects a scheme-containing
value', matching the simpler behaviour. Updated the regression tests
to match: a scheme-containing value (even a well-formed one) is now
rejected outright instead of being normalised.

* Sync SimplePie
https://github.com/FreshRSS/simplepie/pull/95

* Simplify CURLOPT_PROXY validation to a single str_contains('/') check

Per review (AI-assisted, credited to Inverle): a regex was more than this
needs and had a regression -- it rejected valid IPv6 proxies like [::1]:8080
because their host part contains multiple colons. A proxy value never
legitimately contains a "/": that single check still rejects a scheme
(scheme:// always contains "/") and the original exploit payload, and
additionally blocks a SOCKS Unix-domain-socket path such as
localhost:9050/path/to.sock -- cURL treats that specially for SOCKS
proxies and ignores the port, so an allowlisted host:port could otherwise
be smuggled into connecting to an arbitrary local socket.

Also bumped the vendored SimplePie commit in lib/composer.json now that
the companion fix (FreshRSS/simplepie#95) is merged, and added test
cases for the IPv6 and Unix-socket scenarios.

* Reduce comments

---------

Co-authored-by: S31ZUR3 <191032395+S31ZUR3@users.noreply.github.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-09 08:43:08 +01:00
669997ecbe Use a keyed hash for favicon cache keys (#9518)
* Use keyed hash (HMAC-SHA256) for favicon cache keys

The favicon cache key was a CRC-32 checksum of the salt-prefixed feed
website URL (or feed icon URL). CRC-32 is linear, so collisions for
equal-length inputs are independent of the salt prefix: a user could
compute offline a website URL for their own feed colliding into
another feed's cache slot, overwrite the shared
data/favicons/<hash>.txt, and have the unauthenticated public favicon
endpoint fetch and serve their image to every user of the instance.

Replace the checksum with a keyed hash (HMAC-SHA256, instance salt as
key, truncated to 16 hex chars) so the cache key cannot be forged
without the secret salt.

* Preserve legacy custom favicons when upgrading cache keys

* Base64 hash (shorter) and native copy

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Co-authored-by: Inverle <inverle@proton.me>
2026-11-08 20:43:53 +01:00
Mehmet 4ec877d299 Search: quote parentheses and OR when serialising terms (#9541)
`FreshRSS_Search::__toString()` did not quote values containing parentheses or the `OR` keyword, so serialising a parsed search and parsing it again could change its structure (e.g. `"a(b"` was serialised as `a(b`).

   This makes the serialisation lossless for such values, and adds tests, including a round-trip test (parse → toString → parse).
2026-11-08 15:47:15 +01:00
IEEE-754 69f715670f i18n: Improve Traditional Chinese translations (#9540)
- Refine wording
- Fix incorrect translation
- Add some new translations
2026-11-07 19:07:54 +01:00
spa77k b8a738ec12 Add filter preview button to label configuration (#9538)
Closes #9533

- The label configuration panel (`app/views/helpers/tag/update.phtml`) had no "Preview filters on existing articles (new window)" button, unlike the feed, category and global reading settings (the button was added in #7959).
- Add the same button below the auto-labelling filter textarea (`filteractions_label`). It uses the generic `configure/viewFilter` action, as in the global settings, with `filters_name=filteractions_label`.
- Label actions are not scoped to a feed or category: `feedController::applyLabelActions` matches the filter against all new articles. So the generic version, which does not restrict the search with `c:` or `f:`, is the appropriate one.
- The existing translation key `sub.feed.filteractions.view_filter` is reused, so no new translation is needed.
2026-11-06 17:51:25 +01:00
i @manandAlexandre Alapetite 4e8a258b01 Support choosing the sort type when creating or editing a user query (#8954)
* Support choosing the sort type when creating or editing a user query

Changes
- User queries can now store a sort field (sort type), not only the sort
  direction. The create and edit forms expose a single combined dropdown
  (field + direction) that reuses the existing `index.menu.sort.*` options,
  matching the global reading-settings sort UI.
- The "Bookmark current query" action now also remembers the current sort
  field, where it previously kept only the order direction.
- Relabel the query sort control from "Sort by date" to "Sort by"; other
  languages are marked for re-translation (// TODO).
- Add a CHANGELOG entry and credit the contributor in CREDITS.

Implementation
- `FreshRSS_UserQuery`: add an optional `sort` property mirroring `order`
  (constructor parsing, `toArray()`, `getSort()` falling back to the user
  default sort, and a `hasParameters()` check).
- `configureController`: split the combined dropdown value into `sort` and
  `order`, validating the field against the implemented sort types
  (`id`, `c.name`, `date`, `f.name`, `length`, `link`, `title`, `rand`);
  separate `sort`/`order` request parameters are still accepted so the
  "bookmark current query" flow keeps working.
- Views render the combined dropdown and persist `sort` as a hidden field.
- `p/api/query.php`: back-fill `sort` from the saved query when the request
  does not provide one, mirroring the existing `order` handling.
- Add unit tests covering the sort round-trip and `toArray()` inclusion.

Compatibility
- No database or schema change: user queries are stored in the per-user PHP
  config array, which keeps arbitrary keys verbatim, so no migration is
  required.
- Upgrade: existing queries without `sort` fall back to the user default
  sort; behaviour is unchanged until a sort is explicitly chosen.
- Downgrade: older versions ignore the extra `sort` key and keep working;
  re-saving under an old version simply drops the key with no data loss.
- Shared query URLs without a `sort` parameter remain valid.

* Refresh README translation statistics

* i18n: fr

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-02 21:43:05 +01:00