Commit Graph

1285 Commits

Author SHA1 Message Date
Simon Michael
35c1c9b6a2 pkg: progress towards supporting GHC 9.2 and newer libs (#1774)
hledger-lib builds, hledger's deps don't (shakespeare).
2021-12-06 12:32:50 -10:00
Simon Michael
2a58331024 ;doc: update manuals 2021-12-05 10:56:41 -10:00
Simon Michael
ce3ec28e3d ;cabal: update cabal files 2021-12-01 22:16:37 -10:00
Simon Michael
66619803b7 ;pkg: bump version to 1.24.99 2021-12-01 22:16:37 -10:00
Simon Michael
5648db0fd5 doc: update manuals 2021-12-01 20:59:33 -10:00
Simon Michael
2382fe5db8 ;doc: finalise changelogs 2021-12-01 18:23:16 -10:00
Simon Michael
0c4b820111 ;cabal: update cabal files 2021-12-01 17:16:28 -10:00
Simon Michael
387325b59e ;pkg: bump version to 1.24 2021-12-01 17:16:28 -10:00
Simon Michael
1d3f7a2aad ;doc: update manuals 2021-12-01 17:16:04 -10:00
Simon Michael
55f5aa9238 ;doc: changelog edits 2021-11-26 21:06:52 -10:00
Simon Michael
4933b9fc45 ;doc: draft changelogs 2021-11-26 12:02:36 -10:00
Simon Michael
791f4655df ;doc: update manuals 2021-11-26 05:58:55 -10:00
Simon Michael
cf15dbd7c9 ;doc: update manuals 2021-11-18 22:26:10 -10:00
Simon Michael
7af2e79465 ;cabal: update cabal files 2021-10-03 22:56:02 -10:00
Simon Michael
69905dbc25 ;pkg: allow megaparsec 9.2 2021-10-03 22:55:10 -10:00
Simon Michael
b857307f64 ;cabal: update cabal files 2021-09-24 12:22:15 -10:00
Simon Michael
8934c115bd ;pkg: bump version to 1.23.99 2021-09-24 12:22:15 -10:00
Simon Michael
e90fa3ee81 doc: changelogs: cleanup, finalise 2021-09-21 17:15:39 -10:00
Simon Michael
416555b65a doc: update manuals 2021-09-21 17:15:39 -10:00
Simon Michael
1b020e004b ;cabal: update cabal files 2021-09-21 15:34:23 -10:00
Simon Michael
19950df745 ;pkg: bump version to 1.23 2021-09-21 15:34:23 -10:00
Simon Michael
bb4f2ff34f ;doc: update changelogs 2021-09-20 17:58:29 -10:00
Simon Michael
9cae7a076a ;doc: update manuals 2021-09-20 16:56:36 -10:00
Stephen Morgan
4cfd3cb590 lib!: Remove GenericSourcePos, and replace it with either SourcePos or
(SourcePos, SourcePos).

This has been marked for possible removal for a while. We are keeping
strictly more information. Possible edge cases arise with Timeclock and
CsvReader, but I think these are covered.

The particular motivation for getting rid of this is that
GenericSourcePos is creating some awkward import considerations for
little gain. Removing this enables some flattening of the module
dependency tree.
2021-09-20 08:38:33 -10:00
Stephen Morgan
a24f9a61df fix: web: Toggle showing zero elements properly even when called with
--empty. (#1237)

Calling with --empty now overrides any cookies determining whether
zero accounts are hidden.
2021-09-18 11:50:36 -10:00
Simon Michael
993e381307 ;doc: update manuals 2021-09-18 11:24:52 -10:00
Simon Michael
8a4cea2a69 ;doc: update manuals 2021-09-17 17:58:10 -10:00
Stephen Morgan
df424a7a96 fix: web: Do not hide empty accounts if they have non-empty subaccounts. (#1237) 2021-09-10 16:44:57 -10:00
Simon Michael
7a249cffe9 ;doc: update manuals 2021-09-09 14:45:01 -10:00
Stephen Morgan
3456fcb862 test: ui: web: Use report date from _rsDay for hledger-ui and
hledger-web, rather than getCurrentDay.

File watching in hledger-ui continues to use getCurrentDay.
2021-09-09 14:40:39 -10:00
Stephen Morgan
4cb631c0f2 fix: web: Handle non-regular postings in the add transaction form. (#1058) 2021-09-08 13:21:50 -10:00
Stephen Morgan
8274da81fc cln: tests: Remove test and tests, which are just aliases for testCase
and testGroup.

Replacing these removes a layer of indirection, and reduces the need to
depend on Hledger.Utils.Test.
2021-08-30 16:32:19 -10:00
Stephen Morgan
83aa7324eb dev: cli: Move Template Haskell to get git hash from Hledger.Cli.Version
to Hledger.Cli.

Since the git hash changes whenever any file in the repository changes,
this means Hledger.Cli.Version needs to be recompiled all the time.
Since it is at the bottom of the module hierarchy, this means that the
whole hledger package needs to be recompiled. We instead move the
TemplateHaskell splice to one of the top modules, so much less needs to
be recompiled.

Note: Ghc seems to be able to get out of most of the recompiling a lot
of the time (due to caching?), but this makes things more reliable.
2021-08-30 15:57:33 -10:00
Stephen Morgan
1ed06f3bc8 pkg!: Remove Hledger.Utils.UTF8IOCompat module.
This module does nothing beyond define error' and usageError, which have
been moved to Hledger.Utils.
2021-08-30 15:57:33 -10:00
Stephen Morgan
13206d0b18 cln: Rename balancingOpts to defbalancingopts, to be consistent with definputopts, defreportopts, etc. 2021-08-28 19:12:04 -10:00
Stephen Morgan
32dad455fd cln: hlint: Clean up section related warnings. 2021-08-27 06:13:56 -10:00
Stephen Morgan
1a534e485c cln: hlint: Use fewer imports. 2021-08-27 06:13:56 -10:00
Stephen Morgan
8bf7c95697 cln: hlint: Clean up Functor related hlint warnings, and NOINLINE warning. 2021-08-27 06:13:56 -10:00
Stephen Morgan
330c21659f cln: hlint: Clean up Maybe related hlint warnings. 2021-08-27 06:13:56 -10:00
Stephen Morgan
e13239386f cln: hlint: Clean up == and elem related hlint warnings. 2021-08-27 06:13:56 -10:00
Stephen Morgan
eb6047e81b cln: hlint: Remove redundant where and lambda warnings. 2021-08-26 21:00:35 -10:00
Simon Michael
8bf7cd30ae ;doc: update changelogs 2021-08-26 20:59:45 -10:00
Simon Michael
093c304834 ;doc: ui, web: changelogs tweak 2021-08-24 05:31:27 -10:00
Simon Michael
bffeab45c8 ;doc: update changelogs 2021-08-24 05:14:24 -10:00
Simon Michael
53d9455bdc ;doc: update changelogs 2021-08-24 05:05:50 -10:00
Arsen Arsenović
3504a91b42 ref: web: refactor toBloodhoundJson for Data.Text
This has the advantage of there being no extra unpacking/packing of
Data.Text to/from strings where it isn't necessary.
2021-08-24 05:04:12 -10:00
Arsen Arsenović
9ce55146c8 fix: web: b64 encode user controlled input (#1525)
This fixes a reported Stored XSS vulnerability in toBloodhoundJson by
encoding the user-controlled values in this payload into base64 and
parsing them with atob.

In my exploration of the vulnerability with various payloads I and
others crafted, it would appear that this is the only available XSS in
hledger-web in relation to stored accounts and transaction details. If
there is other parts of the UI which may contain user-controlled data,
they should be examined for similar things. In this instance,
protections provided by yesod and other libraries worked fine, but in a
bit of code that hledger-web was generating, the user could insert a
</Script> tag (which is valid HTML and equivalent to </script> but not
caught by the T.Replace that existed in toBloodhoundJson) in order to
switch out of a script context, allowing the parser to be reset, and for
arbitrary JavaScript to run.

The real fix is a bit more involved, but produces much better results:
Content-Security-Policy headers should be introduced, and using
sha256-<hash of script> or a different algorithm, they should be marked
as trusted in the header. This way, if the (in-browser) parser and
hledger-web generator disagree on the source code of the script, the
script won't run. Note that this would still be susceptible to attacks
that involve changing the script by escaping from the string inside it
or something similar to that, which can be avoided additionally by using
either the method used in this commit, or a proper JSON encoder.

The second approach has the advantage of preventing further XSS, to the
extent specified above, in practice, a combination of both should be
used, b64 for embedded data and the CSP sha256-hash script-src over
everything else, which will eliminate all injected or malformed script
blocks (via CSP), in combination with eliminating any HTML closing tags
which might occur in stored data (via b64).

This vulnerability appears to have been first introduced when
autocompletion was added in hledger-web, git tag hledger-0.24, commit
hash: ec51d28839

Test payload: </Script><svg onload=alert(1)//>

Closes #1525
2021-08-24 05:04:12 -10:00
Simon Michael
ddeeee6046 ;doc: update changelogs 2021-08-19 18:36:34 -10:00
Arjen Langebaerd
3426030a91 feat: added commodity style commandline option 2021-08-17 22:05:29 -10:00
Simon Michael
d06d4ca080 ;doc: update manuals 2021-08-08 09:39:20 -10:00